(function(a) {
    a.extend(a.fn, {
        validate: function(d) {
            if (this.length) {
                var c = a.data(this[0], "validator");
                if (c) {
                    return c
                }
                c = new a.validator(d, this[0]);
                a.data(this[0], "validator", c);
                if (c.settings.onsubmit) {
                    this.find("input, button").filter(".cancel").click(function() {
                        c.cancelSubmit = true
                    });
                    c.settings.submitHandler && this.find("input, button").filter(":submit").click(function() {
                        c.submitButton = this
                    });
                    this.submit(function(f) {
                        function b() {
                            if (c.settings.submitHandler) {
                                if (c.submitButton) {
                                    var e = a("<input type='hidden'/>").attr("name", c.submitButton.name).val(c.submitButton.value).appendTo(c.currentForm)
                                }
                                c.settings.submitHandler.call(c, c.currentForm);
                                c.submitButton && e.remove();
                                return false
                            }
                            return true
                        }
                        c.settings.debug && f.preventDefault();
                        if (c.cancelSubmit) {
                            c.cancelSubmit = false;
                            return b()
                        }
                        if (c.form()) {
                            if (c.pendingRequest) {
                                c.formSubmitted = true;
                                return false
                            }
                            return b()
                        } else {
                            c.focusInvalid();
                            return false
                        }
                    })
                }
                return c
            } else {
                d && d.debug && window.console && console.warn("nothing selected, can't validate, returning nothing")
            }
        },
        valid: function() {
            if (a(this[0]).is("form")) {
                return this.validate().form()
            } else {
                var d = true,
                c = a(this[0].form).validate();
                this.each(function() {
                    d &= c.element(this)
                });
                return d
            }
        },
        removeAttrs: function(e) {
            var c = {},
            f = this;
            a.each(e.split(/\s/),
            function(d, b) {
                c[b] = f.attr(b);
                f.removeAttr(b)
            });
            return c
        },
        rules: function(i, c) {
            var n = this[0];
            if (i) {
                var m = a.data(n.form, "validator").settings,
                l = m.rules,
                k = a.validator.staticRules(n);
                switch (i) {
                case "add":
                    a.extend(k, a.validator.normalizeRule(c));
                    l[n.name] = k;
                    if (c.messages) {
                        m.messages[n.name] = a.extend(m.messages[n.name], c.messages)
                    }
                    break;
                case "remove":
                    if (!c) {
                        delete l[n.name];
                        return k
                    }
                    var j = {};
                    a.each(c.split(/\s/),
                    function(b, d) {
                        j[d] = k[d];
                        delete k[d]
                    });
                    return j
                }
            }
            n = a.validator.normalizeRules(a.extend({},
            a.validator.metadataRules(n), a.validator.classRules(n), a.validator.attributeRules(n), a.validator.staticRules(n)), n);
            if (n.required) {
                m = n.required;
                delete n.required;
                n = a.extend({
                    required: m
                },
                n)
            }
            return n
        }
    });
    a.extend(a.expr[":"], {
        blank: function(b) {
            return ! a.trim("" + b.value)
        },
        filled: function(b) {
            return !! a.trim("" + b.value)
        },
        unchecked: function(b) {
            return ! b.checked
        }
    });
    a.validator = function(d, c) {
        this.settings = a.extend(true, {},
        a.validator.defaults, d);
        this.currentForm = c;
        this.init()
    };
    a.validator.format = function(d, c) {
        if (arguments.length == 1) {
            return function() {
                var b = a.makeArray(arguments);
                b.unshift(d);
                return a.validator.format.apply(this, b)
            }
        }
        if (arguments.length > 2 && c.constructor != Array) {
            c = a.makeArray(arguments).slice(1)
        }
        if (c.constructor != Array) {
            c = [c]
        }
        a.each(c,
        function(f, b) {
            d = d.replace(RegExp("\\{" + f + "\\}", "g"), b)
        });
        return d
    };
    a.extend(a.validator, {
        defaults: {
            messages: {},
            groups: {},
            rules: {},
            errorClass: "error",
            validClass: "valid",
            errorElement: "label",
            focusInvalid: true,
            errorContainer: a([]),
            errorLabelContainer: a([]),
            onsubmit: true,
            ignore: [],
            ignoreTitle: false,
            onfocusin: function(b) {
                this.lastActive = b;
                if (this.settings.focusCleanup && !this.blockFocusCleanup) {
                    this.settings.unhighlight && this.settings.unhighlight.call(this, b, this.settings.errorClass, this.settings.validClass);
                    this.addWrapper(this.errorsFor(b)).hide()
                }
            },
            onfocusout: function(b) {
                if (!this.checkable(b) && (b.name in this.submitted || !this.optional(b))) {
                    this.element(b)
                }
            },
            onkeyup: function(b) {
                if (b.name in this.submitted || b == this.lastElement) {
                    this.element(b)
                }
            },
            onclick: function(b) {
                if (b.name in this.submitted) {
                    this.element(b)
                } else {
                    b.parentNode.name in this.submitted && this.element(b.parentNode)
                }
            },
            highlight: function(e, c, f) {
                e.type === "radio" ? this.findByName(e.name).addClass(c).removeClass(f) : a(e).addClass(c).removeClass(f)
            },
            unhighlight: function(e, c, f) {
                e.type === "radio" ? this.findByName(e.name).removeClass(c).addClass(f) : a(e).removeClass(c).addClass(f)
            }
        },
        setDefaults: function(b) {
            a.extend(a.validator.defaults, b)
        },
        messages: {
            required: "This field is required.",
            remote: "Please fix this field.",
            email: "Please enter a valid email address.",
            url: "Please enter a valid URL.",
            date: "Please enter a valid date.",
            dateISO: "Please enter a valid date (ISO).",
            number: "Please enter a valid number.",
            digits: "Please enter only digits.",
            creditcard: "Please enter a valid credit card number.",
            equalTo: "Please enter the same value again.",
            accept: "Please enter a value with a valid extension.",
            maxlength: a.validator.format("Please enter no more than {0} characters."),
            minlength: a.validator.format("Please enter at least {0} characters."),
            rangelength: a.validator.format("Please enter a value between {0} and {1} characters long."),
            range: a.validator.format("Please enter a value between {0} and {1}."),
            max: a.validator.format("Please enter a value less than or equal to {0}."),
            min: a.validator.format("Please enter a value greater than or equal to {0}.")
        },
        autoCreateRanges: false,
        prototype: {
            init: function() {
                function e(d) {
                    var b = a.data(this[0].form, "validator");
                    d = "on" + d.type.replace(/^validate/, "");
                    b.settings[d] && b.settings[d].call(b, this[0])
                }
                this.labelContainer = a(this.settings.errorLabelContainer);
                this.errorContext = this.labelContainer.length && this.labelContainer || a(this.currentForm);
                this.containers = a(this.settings.errorContainer).add(this.settings.errorLabelContainer);
                this.submitted = {};
                this.valueCache = {};
                this.pendingRequest = 0;
                this.pending = {};
                this.invalid = {};
                this.reset();
                var c = this.groups = {};
                a.each(this.settings.groups,
                function(d, b) {
                    a.each(b.split(/\s/),
                    function(j, i) {
                        c[i] = d
                    })
                });
                var f = this.settings.rules;
                a.each(f,
                function(d, b) {
                    f[d] = a.validator.normalizeRule(b)
                });
                a(this.currentForm).validateDelegate(":text, :password, :file, select, textarea", "focusin focusout keyup", e).validateDelegate(":radio, :checkbox, select, option", "click", e);
                this.settings.invalidHandler && a(this.currentForm).bind("invalid-form.validate", this.settings.invalidHandler)
            },
            form: function() {
                this.checkForm();
                a.extend(this.submitted, this.errorMap);
                this.invalid = a.extend({},
                this.errorMap);
                this.valid() || a(this.currentForm).triggerHandler("invalid-form", [this]);
                this.showErrors();
                return this.valid()
            },
            checkForm: function() {
                this.prepareForm();
                for (var d = 0,
                c = this.currentElements = this.elements(); c[d]; d++) {
                    this.check(c[d])
                }
                return this.valid()
            },
            element: function(d) {
                this.lastElement = d = this.clean(d);
                this.prepareElement(d);
                this.currentElements = a(d);
                var c = this.check(d);
                if (c) {
                    delete this.invalid[d.name]
                } else {
                    this.invalid[d.name] = true
                }
                if (!this.numberOfInvalids()) {
                    this.toHide = this.toHide.add(this.containers)
                }
                this.showErrors();
                return c
            },
            showErrors: function(d) {
                if (d) {
                    a.extend(this.errorMap, d);
                    this.errorList = [];
                    for (var c in d) {
                        this.errorList.push({
                            message: d[c],
                            element: this.findByName(c)[0]
                        })
                    }
                    this.successList = a.grep(this.successList,
                    function(b) {
                        return ! (b.name in d)
                    })
                }
                this.settings.showErrors ? this.settings.showErrors.call(this, this.errorMap, this.errorList) : this.defaultShowErrors()
            },
            resetForm: function() {
                a.fn.resetForm && a(this.currentForm).resetForm();
                this.submitted = {};
                this.prepareForm();
                this.hideErrors();
                this.elements().removeClass(this.settings.errorClass)
            },
            numberOfInvalids: function() {
                return this.objectLength(this.invalid)
            },
            objectLength: function(e) {
                var c = 0,
                f;
                for (f in e) {
                    c++
                }
                return c
            },
            hideErrors: function() {
                this.addWrapper(this.toHide).hide()
            },
            valid: function() {
                return this.size() == 0
            },
            size: function() {
                return this.errorList.length
            },
            focusInvalid: function() {
                if (this.settings.focusInvalid) {
                    try {
                        a(this.findLastActive() || this.errorList.length && this.errorList[0].element || []).filter(":visible").focus().trigger("focusin")
                    } catch(b) {}
                }
            },
            findLastActive: function() {
                var b = this.lastActive;
                return b && a.grep(this.errorList,
                function(c) {
                    return c.element.name == b.name
                }).length == 1 && b
            },
            elements: function() {
                var d = this,
                c = {};
                return a(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function() { ! this.name && d.settings.debug && window.console && console.error("%o has no name assigned", this);
                    if (this.name in c || !d.objectLength(a(this).rules())) {
                        return false
                    }
                    return c[this.name] = true
                })
            },
            clean: function(b) {
                return a(b)[0]
            },
            errors: function() {
                return a(this.settings.errorElement + "." + this.settings.errorClass, this.errorContext)
            },
            reset: function() {
                this.successList = [];
                this.errorList = [];
                this.errorMap = {};
                this.toShow = a([]);
                this.toHide = a([]);
                this.currentElements = a([])
            },
            prepareForm: function() {
                this.reset();
                this.toHide = this.errors().add(this.containers)
            },
            prepareElement: function(b) {
                this.reset();
                this.toHide = this.errorsFor(b)
            },
            check: function(i) {
                i = this.clean(i);
                if (this.checkable(i)) {
                    i = this.findByName(i.name).not(this.settings.ignore)[0]
                }
                var c = a(i).rules(),
                n = false,
                m;
                for (m in c) {
                    var l = {
                        method: m,
                        parameters: c[m]
                    };
                    try {
                        var k = a.validator.methods[m].call(this, i.value.replace(/\r/g, ""), i, l.parameters);
                        if (k == "dependency-mismatch") {
                            n = true
                        } else {
                            n = false;
                            if (k == "pending") {
                                this.toHide = this.toHide.not(this.errorsFor(i));
                                return
                            }
                            if (!k) {
                                this.formatAndAdd(i, l);
                                return false
                            }
                        }
                    } catch(j) {
                        this.settings.debug && window.console && console.log("exception occured when checking element " + i.id + ", check the '" + l.method + "' method", j);
                        throw j
                    }
                }
                if (!n) {
                    this.objectLength(c) && this.successList.push(i);
                    return true
                }
            },
            customMetaMessage: function(e, c) {
                if (a.metadata) {
                    var f = this.settings.meta ? a(e).metadata()[this.settings.meta] : a(e).metadata();
                    return f && f.messages && f.messages[c]
                }
            },
            customMessage: function(e, c) {
                var f = this.settings.messages[e];
                return f && (f.constructor == String ? f: f[c])
            },
            findDefined: function() {
                for (var b = 0; b < arguments.length; b++) {
                    if (arguments[b] !== undefined) {
                        return arguments[b]
                    }
                }
            },
            defaultMessage: function(d, c) {
                return this.findDefined(this.customMessage(d.name, c), this.customMetaMessage(d, c), !this.settings.ignoreTitle && d.title || undefined, a.validator.messages[c], "<strong>Warning: No message defined for " + d.name + "</strong>")
            },
            formatAndAdd: function(f, c) {
                var h = this.defaultMessage(f, c.method),
                g = /\$?\{(\d+)\}/g;
                if (typeof h == "function") {
                    h = h.call(this, c.parameters, f)
                } else {
                    if (g.test(h)) {
                        h = jQuery.format(h.replace(g, "{$1}"), c.parameters)
                    }
                }
                this.errorList.push({
                    message: h,
                    element: f
                });
                this.errorMap[f.name] = h;
                this.submitted[f.name] = h
            },
            addWrapper: function(b) {
                if (this.settings.wrapper) {
                    b = b.add(b.parent(this.settings.wrapper))
                }
                return b
            },
            defaultShowErrors: function() {
                for (var d = 0; this.errorList[d]; d++) {
                    var c = this.errorList[d];
                    this.settings.highlight && this.settings.highlight.call(this, c.element, this.settings.errorClass, this.settings.validClass);
                    this.showLabel(c.element, c.message)
                }
                if (this.errorList.length) {
                    this.toShow = this.toShow.add(this.containers)
                }
                if (this.settings.success) {
                    for (d = 0; this.successList[d]; d++) {
                        this.showLabel(this.successList[d])
                    }
                }
                if (this.settings.unhighlight) {
                    d = 0;
                    for (c = this.validElements(); c[d]; d++) {
                        this.settings.unhighlight.call(this, c[d], this.settings.errorClass, this.settings.validClass)
                    }
                }
                this.toHide = this.toHide.not(this.toShow);
                this.hideErrors();
                this.addWrapper(this.toShow).show()
            },
            validElements: function() {
                return this.currentElements.not(this.invalidElements())
            },
            invalidElements: function() {
                return a(this.errorList).map(function() {
                    return this.element
                })
            },
            showLabel: function(e, c) {
                var f = this.errorsFor(e);
                if (f.length) {
                    f.removeClass().addClass(this.settings.errorClass);
                    f.attr("generated") && f.html(c)
                } else {
                    f = a("<" + this.settings.errorElement + "/>").attr({
                        "for": this.idOrName(e),
                        generated: true
                    }).addClass(this.settings.errorClass).html(c || "");
                    if (this.settings.wrapper) {
                        f = f.hide().show().wrap("<" + this.settings.wrapper + "/>").parent()
                    }
                    this.labelContainer.append(f).length || (this.settings.errorPlacement ? this.settings.errorPlacement(f, a(e)) : f.insertAfter(e))
                }
                if (!c && this.settings.success) {
                    f.text("");
                    typeof this.settings.success == "string" ? f.addClass(this.settings.success) : this.settings.success(f)
                }
                this.toShow = this.toShow.add(f)
            },
            errorsFor: function(d) {
                var c = this.idOrName(d);
                return this.errors().filter(function() {
                    return a(this).attr("for") == c
                })
            },
            idOrName: function(b) {
                return this.groups[b.name] || (this.checkable(b) ? b.name: b.id || b.name)
            },
            checkable: function(b) {
                return /radio|checkbox/i.test(b.type)
            },
            findByName: function(d) {
                var c = this.currentForm;
                return a(document.getElementsByName(d)).map(function(f, b) {
                    return b.form == c && b.name == d && b || null
                })
            },
            getLength: function(d, c) {
                switch (c.nodeName.toLowerCase()) {
                case "select":
                    return a("option:selected", c).length;
                case "input":
                    if (this.checkable(c)) {
                        return this.findByName(c.name).filter(":checked").length
                    }
                }
                return d.length
            },
            depend: function(d, c) {
                return this.dependTypes[typeof d] ? this.dependTypes[typeof d](d, c) : true
            },
            dependTypes: {
                "boolean": function(b) {
                    return b
                },
                string: function(d, c) {
                    return !! a(d, c.form).length
                },
                "function": function(d, c) {
                    return d(c)
                }
            },
            optional: function(b) {
                return ! a.validator.methods.required.call(this, a.trim(b.value), b) && "dependency-mismatch"
            },
            startRequest: function(b) {
                if (!this.pending[b.name]) {
                    this.pendingRequest++;
                    this.pending[b.name] = true
                }
            },
            stopRequest: function(d, c) {
                this.pendingRequest--;
                if (this.pendingRequest < 0) {
                    this.pendingRequest = 0
                }
                delete this.pending[d.name];
                if (c && this.pendingRequest == 0 && this.formSubmitted && this.form()) {
                    a(this.currentForm).submit();
                    this.formSubmitted = false
                } else {
                    if (!c && this.pendingRequest == 0 && this.formSubmitted) {
                        a(this.currentForm).triggerHandler("invalid-form", [this]);
                        this.formSubmitted = false
                    }
                }
            },
            previousValue: function(b) {
                return a.data(b, "previousValue") || a.data(b, "previousValue", {
                    old: null,
                    valid: true,
                    message: this.defaultMessage(b, "remote")
                })
            }
        },
        classRuleSettings: {
            required: {
                required: true
            },
            email: {
                email: true
            },
            url: {
                url: true
            },
            date: {
                date: true
            },
            dateISO: {
                dateISO: true
            },
            dateDE: {
                dateDE: true
            },
            number: {
                number: true
            },
            numberDE: {
                numberDE: true
            },
            digits: {
                digits: true
            },
            creditcard: {
                creditcard: true
            }
        },
        addClassRules: function(d, c) {
            d.constructor == String ? this.classRuleSettings[d] = c: a.extend(this.classRuleSettings, d)
        },
        classRules: function(d) {
            var c = {}; (d = a(d).attr("class")) && a.each(d.split(" "),
            function() {
                this in a.validator.classRuleSettings && a.extend(c, a.validator.classRuleSettings[this])
            });
            return c
        },
        attributeRules: function(f) {
            var c = {};
            f = a(f);
            for (var h in a.validator.methods) {
                var g = f.attr(h);
                if (g) {
                    c[h] = g
                }
            }
            c.maxlength && /-1|2147483647|524288/.test(c.maxlength) && delete c.maxlength;
            return c
        },
        metadataRules: function(d) {
            if (!a.metadata) {
                return {}
            }
            var c = a.data(d.form, "validator").settings.meta;
            return c ? a(d).metadata()[c] : a(d).metadata()
        },
        staticRules: function(e) {
            var c = {},
            f = a.data(e.form, "validator");
            if (f.settings.rules) {
                c = a.validator.normalizeRule(f.settings.rules[e.name]) || {}
            }
            return c
        },
        normalizeRules: function(d, c) {
            a.each(d,
            function(h, g) {
                if (g === false) {
                    delete d[h]
                } else {
                    if (g.param || g.depends) {
                        var b = true;
                        switch (typeof g.depends) {
                        case "string":
                            b = !!a(g.depends, c.form).length;
                            break;
                        case "function":
                            b = g.depends.call(c, c)
                        }
                        if (b) {
                            d[h] = g.param !== undefined ? g.param: true
                        } else {
                            delete d[h]
                        }
                    }
                }
            });
            a.each(d,
            function(f, b) {
                d[f] = a.isFunction(b) ? b(c) : b
            });
            a.each(["minlength", "maxlength", "min", "max"],
            function() {
                if (d[this]) {
                    d[this] = Number(d[this])
                }
            });
            a.each(["rangelength", "range"],
            function() {
                if (d[this]) {
                    d[this] = [Number(d[this][0]), Number(d[this][1])]
                }
            });
            if (a.validator.autoCreateRanges) {
                if (d.min && d.max) {
                    d.range = [d.min, d.max];
                    delete d.min;
                    delete d.max
                }
                if (d.minlength && d.maxlength) {
                    d.rangelength = [d.minlength, d.maxlength];
                    delete d.minlength;
                    delete d.maxlength
                }
            }
            d.messages && delete d.messages;
            return d
        },
        normalizeRule: function(d) {
            if (typeof d == "string") {
                var c = {};
                a.each(d.split(/\s/),
                function() {
                    c[this] = true
                });
                d = c
            }
            return d
        },
        addMethod: function(e, c, f) {
            a.validator.methods[e] = c;
            a.validator.messages[e] = f != undefined ? f: a.validator.messages[e];
            c.length < 3 && a.validator.addClassRules(e, a.validator.normalizeRule(e))
        },
        methods: {
            required: function(e, c, f) {
                if (!this.depend(f, c)) {
                    return "dependency-mismatch"
                }
                switch (c.nodeName.toLowerCase()) {
                case "select":
                    return (e = a(c).val()) && e.length > 0;
                case "input":
                    if (this.checkable(c)) {
                        return this.getLength(e, c) > 0
                    }
                default:
                    return a.trim(e).length > 0
                }
            },
            remote: function(h, c, l) {
                if (this.optional(c)) {
                    return "dependency-mismatch"
                }
                var k = this.previousValue(c);
                this.settings.messages[c.name] || (this.settings.messages[c.name] = {});
                k.originalMessage = this.settings.messages[c.name].remote;
                this.settings.messages[c.name].remote = k.message;
                l = typeof l == "string" && {
                    url: l
                } || l;
                if (this.pending[c.name]) {
                    return "pending"
                }
                if (k.old === h) {
                    return k.valid
                }
                k.old = h;
                var j = this;
                this.startRequest(c);
                var i = {};
                i[c.name] = h;
                a.ajax(a.extend(true, {
                    url: l,
                    mode: "abort",
                    port: "validate" + c.name,
                    dataType: "json",
                    data: i,
                    success: function(e) {
                        j.settings.messages[c.name].remote = k.originalMessage;
                        var b = e === true;
                        if (b) {
                            var d = j.formSubmitted;
                            j.prepareElement(c);
                            j.formSubmitted = d;
                            j.successList.push(c);
                            j.showErrors()
                        } else {
                            d = {};
                            e = e || j.defaultMessage(c, "remote");
                            d[c.name] = k.message = a.isFunction(e) ? e(h) : e;
                            j.showErrors(d)
                        }
                        k.valid = b;
                        j.stopRequest(c, b)
                    }
                },
                l));
                return "pending"
            },
            minlength: function(e, c, f) {
                return this.optional(c) || this.getLength(a.trim(e), c) >= f
            },
            maxlength: function(e, c, f) {
                return this.optional(c) || this.getLength(a.trim(e), c) <= f
            },
            rangelength: function(e, c, f) {
                e = this.getLength(a.trim(e), c);
                return this.optional(c) || e >= f[0] && e <= f[1]
            },
            min: function(e, c, f) {
                return this.optional(c) || e >= f
            },
            max: function(e, c, f) {
                return this.optional(c) || e <= f
            },
            range: function(e, c, f) {
                return this.optional(c) || e >= f[0] && e <= f[1]
            },
            email: function(d, c) {
                return this.optional(c) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(d)
            },
            url: function(d, c) {
                return this.optional(c) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(d)
            },
            date: function(d, c) {
                return this.optional(c) || !/Invalid|NaN/.test(new Date(d))
            },
            dateISO: function(d, c) {
                return this.optional(c) || /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(d)
            },
            number: function(d, c) {
                return this.optional(c) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(d)
            },
            digits: function(d, c) {
                return this.optional(c) || /^\d+$/.test(d)
            },
            creditcard: function(h, c) {
                if (this.optional(c)) {
                    return "dependency-mismatch"
                }
                if (/[^0-9-]+/.test(h)) {
                    return false
                }
                var l = 0,
                k = 0,
                j = false;
                h = h.replace(/\D/g, "");
                for (var i = h.length - 1; i >= 0; i--) {
                    k = h.charAt(i);
                    k = parseInt(k, 10);
                    if (j) {
                        if ((k *= 2) > 9) {
                            k -= 9
                        }
                    }
                    l += k;
                    j = !j
                }
                return l % 10 == 0
            },
            accept: function(e, c, f) {
                f = typeof f == "string" ? f.replace(/,/g, "|") : "png|jpe?g|gif";
                return this.optional(c) || e.match(RegExp(".(" + f + ")$", "i"))
            },
            equalTo: function(e, c, f) {
                f = a(f).unbind(".validate-equalTo").bind("blur.validate-equalTo",
                function() {
                    a(c).valid()
                });
                return e == f.val()
            }
        }
    });
    a.format = a.validator.format
})(jQuery); (function(f) {
    var e = {};
    if (f.ajaxPrefilter) {
        f.ajaxPrefilter(function(c, b, a) {
            b = c.port;
            if (c.mode == "abort") {
                e[b] && e[b].abort();
                e[b] = a
            }
        })
    } else {
        var d = f.ajax;
        f.ajax = function(b) {
            var a = ("port" in b ? b: f.ajaxSettings).port;
            if (("mode" in b ? b: f.ajaxSettings).mode == "abort") {
                e[a] && e[a].abort();
                return e[a] = d.apply(this, arguments)
            }
            return d.apply(this, arguments)
        }
    }
})(jQuery); (function(a) { ! jQuery.event.special.focusin && !jQuery.event.special.focusout && document.addEventListener && a.each({
        focus: "focusin",
        blur: "focusout"
    },
    function(e, c) {
        function f(b) {
            b = a.event.fix(b);
            b.type = c;
            return a.event.handle.call(this, b)
        }
        a.event.special[c] = {
            setup: function() {
                this.addEventListener(e, f, true)
            },
            teardown: function() {
                this.removeEventListener(e, f, true)
            },
            handler: function(b) {
                arguments[0] = a.event.fix(b);
                arguments[0].type = c;
                return a.event.handle.apply(this, arguments)
            }
        }
    });
    a.extend(a.fn, {
        validateDelegate: function(e, c, f) {
            return this.bind(c,
            function(d) {
                var b = a(d.target);
                if (b.is(e)) {
                    return f.apply(b, arguments)
                }
            })
        }
    })
})(jQuery); !
function(f) {
    var b;
    f(document).ready(function() {
        f.support.transition = (function() {
            var j = document.body || document.documentElement,
            k = j.style,
            i = k.transition !== undefined || k.WebkitTransition !== undefined || k.MozTransition !== undefined || k.MsTransition !== undefined || k.OTransition !== undefined;
            return i
        })();
        if (f.support.transition) {
            b = "TransitionEnd";
            if (f.browser.webkit) {
                b = "webkitTransitionEnd"
            } else {
                if (f.browser.mozilla) {
                    b = "transitionend"
                } else {
                    if (f.browser.opera) {
                        b = "oTransitionEnd"
                    }
                }
            }
        }
    });
    var a = function(j, i) {
        this.settings = f.extend({},
        f.fn.modal.defaults, i);
        this.$element = f(j).delegate(".close", "click.modal", f.proxy(this.hide, this));
        if (this.settings.show) {
            this.show()
        }
        return this
    };
    a.prototype = {
        toggle: function() {
            return this[!this.isShown ? "show": "hide"]()
        },
        show: function() {
            var i = this;
            this.isShown = true;
            this.$element.trigger("show");
            e.call(this);
            d.call(this,
            function() {
                var j = f.support.transition && i.$element.hasClass("fade");
                i.$element.appendTo(document.body).show();
                if (j) {
                    i.$element[0].offsetWidth
                }
                i.$element.addClass("in");
                j ? i.$element.one(b,
                function() {
                    i.$element.trigger("shown")
                }) : i.$element.trigger("shown")
            });
            return this
        },
        hide: function(j) {
            j && j.preventDefault();
            if (!this.isShown) {
                return this
            }
            var i = this;
            this.isShown = false;
            e.call(this);
            this.$element.trigger("hide").removeClass("in");
            f.support.transition && this.$element.hasClass("fade") ? h.call(this) : g.call(this);
            return this
        }
    };
    function h() {
        var i = this,
        j = setTimeout(function() {
            i.$element.unbind(b);
            g.call(i)
        },
        500);
        this.$element.one(b,
        function() {
            clearTimeout(j);
            g.call(i)
        })
    }
    function g(i) {
        this.$element.hide().trigger("hidden");
        d.call(this)
    }
    function d(l) {
        var k = this,
        j = this.$element.hasClass("fade") ? "fade": "";
        if (this.isShown && this.settings.backdrop) {
            var i = f.support.transition && j;
            if (f("body").find(".modal-backdrop").size() <= 0) {
                this.$backdrop = f('<div class="modal-backdrop ' + j + '" />').appendTo(document.body)
            }
            if (this.settings.backdrop != "static") {
                this.$backdrop.click(f.proxy(this.hide, this))
            }
            if (i) {
                this.$backdrop[0].offsetWidth
            }
            this.$backdrop.addClass("in");
            i ? this.$backdrop.one(b, l) : l()
        } else {
            if (!this.isShown && this.$backdrop) {
                this.$backdrop.removeClass("in");
                f.support.transition && this.$element.hasClass("fade") ? this.$backdrop.one(b, f.proxy(c, this)) : c.call(this)
            } else {
                if (l) {
                    l()
                }
            }
        }
    }
    function c() {
        this.$backdrop.remove();
        this.$backdrop = null
    }
    function e() {
        var i = this;
        if (this.isShown && this.settings.keyboard) {
            f(document).bind("keyup.modal",
            function(j) {
                if (j.which == 27) {
                    i.hide()
                }
            })
        } else {
            if (!this.isShown) {
                f(document).unbind("keyup.modal")
            }
        }
    }
    f.fn.modal = function(i) {
        var j = this.data("modal");
        if (!j) {
            if (typeof i == "string") {
                i = {
                    show: /show|toggle/.test(i)
                }
            }
            return this.each(function() {
                f(this).data("modal", new a(this, i))
            })
        }
        if (i === true) {
            return j
        }
        if (typeof i == "string") {
            j[i]()
        } else {
            if (j) {
                j.toggle()
            }
        }
        return this
    };
    f.fn.modal.Modal = a;
    f.fn.modal.defaults = {
        backdrop: false,
        keyboard: false,
        show: false
    };
    f(document).ready(function() {
        f("body").delegate("[data-controls-modal]", "click",
        function(j) {
            j.preventDefault();
            var i = f(this).data("show", true);
            f("#" + i.attr("data-controls-modal")).modal(i.data())
        })
    })
} (window.jQuery || window.ender); !
function(c) {
    function b(e, d) {
        d.find("> .active").removeClass("active").find("> .dropdown-menu > .active").removeClass("active");
        e.addClass("active");
        if (e.parent(".dropdown-menu")) {
            e.closest("li.dropdown").addClass("active")
        }
    }
    function a(i) {
        var h = c(this),
        f = h.closest("ul:not(.dropdown-menu)"),
        d = h.attr("href"),
        g,
        j;
        if (/^#\w+/.test(d)) {
            i.preventDefault();
            if (h.parent("li").hasClass("active")) {
                return
            }
            g = f.find(".active a").last()[0];
            j = c(d);
            b(h.parent("li"), f);
            b(j, j.parent());
            h.trigger({
                type: "change",
                relatedTarget: g
            })
        }
    }
    c.fn.tabs = c.fn.pills = function(d) {
        return this.each(function() {
            c(this).delegate(d || ".tabs li > a, .pills > li > a", "click", a)
        })
    };
    c(document).ready(function() {
        c("body").tabs("ul[data-tabs] li > a, ul[data-pills] > li > a")
    })
} (window.jQuery || window.ender); !
function(b) {
    var a = function(d, c) {
        this.$element = b(d);
        this.options = b.extend({},
        b.fn.button.defaults, c)
    };
    a.prototype = {
        constructor: a,
        setState: function(f) {
            var h = "disabled",
            c = this.$element,
            e = c.data(),
            g = c.is("input") ? "val": "html";
            f = f + "Text";
            e.resetText || c.data("resetText", c[g]());
            c[g](e[f] || this.options[f]);
            setTimeout(function() {
                f == "loadingText" ? c.addClass(h).attr(h, h) : c.removeClass(h).removeAttr(h)
            },
            0)
        },
        toggle: function() {
            var c = this.$element.parent('[data-toggle="buttons-radio"]');
            c && c.find(".active").removeClass("active");
            this.$element.toggleClass("active")
        }
    };
    b.fn.button = function(c) {
        return this.each(function() {
            var f = b(this),
            e = f.data("button"),
            d = typeof c == "object" && c;
            if (!e) {
                f.data("button", (e = new a(this, d)))
            }
            if (c == "toggle") {
                e.toggle()
            } else {
                if (c) {
                    e.setState(c)
                }
            }
        })
    };
    b.fn.button.defaults = {
        loadingText: "loading..."
    };
    b.fn.button.Constructor = a;
    b(function() {
        b("body").on("click.button.data-api", "[data-toggle^=button]",
        function(c) {
            b(c.target).button("toggle")
        })
    })
} (window.jQuery); !
function(b) {
    b.fn.dropdown = function(d) {
        return this.each(function() {
            b(this).delegate(d || c, "click",
            function(h) {
                var f = b(this).parent("li"),
                g = f.hasClass("open");
                a(); ! g && f.toggleClass("open");
                return false
            })
        })
    };
    var c = "a.menu, .dropdown-toggle";
    function a() {
        b(c).parent("li").removeClass("open")
    }
    b(function() {
        b("html").bind("click", a);
        b("body").dropdown("[data-dropdown] a.menu, [data-dropdown] .dropdown-toggle")
    })
} (window.jQuery || window.ender); !
function(b) {
    var a = function(d, c) {
        this.init("tooltip", d, c)
    };
    a.prototype = {
        constructor: a,
        init: function(f, e, d) {
            var g, c;
            this.type = f;
            this.$element = b(e);
            this.options = this.getOptions(d);
            this.enabled = true;
            if (this.options.trigger != "manual") {
                g = this.options.trigger == "hover" ? "mouseenter": "focus";
                c = this.options.trigger == "hover" ? "mouseleave": "blur";
                this.$element.on(g, this.options.selector, b.proxy(this.enter, this));
                this.$element.on(c, this.options.selector, b.proxy(this.leave, this))
            }
            this.options.selector ? (this._options = b.extend({},
            this.options, {
                trigger: "manual",
                selector: ""
            })) : this.fixTitle()
        },
        getOptions: function(c) {
            c = b.extend({},
            b.fn[this.type].defaults, c, this.$element.data());
            if (c.delay && typeof c.delay == "number") {
                c.delay = {
                    show: c.delay,
                    hide: c.delay
                }
            }
            return c
        },
        enter: function(d) {
            var c = b(d.currentTarget)[this.type](this._options).data(this.type);
            if (!c.options.delay || !c.options.delay.show) {
                c.show()
            } else {
                c.hoverState = "in";
                setTimeout(function() {
                    if (c.hoverState == "in") {
                        c.show()
                    }
                },
                c.options.delay.show)
            }
        },
        leave: function(d) {
            var c = b(d.currentTarget)[this.type](this._options).data(this.type);
            if (!c.options.delay || !c.options.delay.hide) {
                c.hide()
            } else {
                c.hoverState = "out";
                setTimeout(function() {
                    if (c.hoverState == "out") {
                        c.hide()
                    }
                },
                c.options.delay.hide)
            }
        },
        show: function() {
            var g, c, i, e, h, d, f;
            if (this.hasContent() && this.enabled) {
                g = this.tip();
                this.setContent();
                if (this.options.animation) {
                    g.addClass("fade")
                }
                d = typeof this.options.placement == "function" ? this.options.placement.call(this, g[0], this.$element[0]) : this.options.placement;
                c = /in/.test(d);
                g.remove().css({
                    top: 0,
                    left: 0,
                    display: "block"
                }).appendTo(c ? this.$element: document.body);
                i = this.getPosition(c);
                e = g[0].offsetWidth;
                h = g[0].offsetHeight;
                switch (c ? d.split(" ")[1] : d) {
                case "bottom":
                    f = {
                        top: i.top + i.height,
                        left: i.left + i.width / 2 - e / 2
                    };
                    break;
                case "top":
                    f = {
                        top: i.top - h,
                        left: i.left + i.width / 2 - e / 2
                    };
                    break;
                case "left":
                    f = {
                        top: i.top + i.height / 2 - h / 2,
                        left: i.left - e
                    };
                    break;
                case "right":
                    f = {
                        top: i.top + i.height / 2 - h / 2,
                        left: i.left + i.width
                    };
                    break
                }
                g.css(f).addClass(d).addClass("in")
            }
        },
        setContent: function() {
            var c = this.tip();
            c.find(".tooltip-inner").html(this.getTitle());
            c.removeClass("fade in top bottom left right")
        },
        hide: function() {
            var c = this,
            d = this.tip();
            d.removeClass("in");
            function e() {
                var f = setTimeout(function() {
                    d.off(b.support.transition.end).remove()
                },
                500);
                d.one(b.support.transition.end,
                function() {
                    clearTimeout(f);
                    d.remove()
                })
            }
            b.support.transition && this.$tip.hasClass("fade") ? e() : d.remove()
        },
        fixTitle: function() {
            var c = this.$element;
            if (c.attr("title") || typeof(c.attr("data-original-title")) != "string") {
                c.attr("data-original-title", c.attr("title") || "").removeAttr("title")
            }
        },
        hasContent: function() {
            return this.getTitle()
        },
        getPosition: function(c) {
            return b.extend({},
            (c ? {
                top: 0,
                left: 0
            }: this.$element.offset()), {
                width: this.$element[0].offsetWidth,
                height: this.$element[0].offsetHeight
            })
        },
        getTitle: function() {
            var e, c = this.$element,
            d = this.options;
            e = c.attr("data-original-title") || (typeof d.title == "function" ? d.title.call(c[0]) : d.title);
            e = (e || "").toString().replace(/(^\s*|\s*$)/, "");
            return e
        },
        tip: function() {
            return this.$tip = this.$tip || b(this.options.template)
        },
        validate: function() {
            if (!this.$element[0].parentNode) {
                this.hide();
                this.$element = null;
                this.options = null
            }
        },
        enable: function() {
            this.enabled = true
        },
        disable: function() {
            this.enabled = false
        },
        toggleEnabled: function() {
            this.enabled = !this.enabled
        },
        toggle: function() {
            this[this.tip().hasClass("in") ? "hide": "show"]()
        }
    };
    b.fn.tooltip = function(c) {
        return this.each(function() {
            var f = b(this),
            e = f.data("tooltip"),
            d = typeof c == "object" && c;
            if (!e) {
                f.data("tooltip", (e = new a(this, d)))
            }
            if (typeof c == "string") {
                e[c]()
            }
        })
    };
    b.fn.tooltip.Constructor = a;
    b.fn.tooltip.defaults = {
        animation: true,
        delay: 0,
        selector: false,
        placement: "top",
        trigger: "hover",
        title: "",
        template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
    }
} (window.jQuery);
var login_modal_first = function() {
    if (dianexia.logined) {
        return true;
    }
 var a = false;
    if (!a) {
        $("#modal-login").modal({
            keyboard: true,
            backdrop: "static"
        });
        a = true
    }
    $("#modal-login").modal("show");
    $("#modal-login .btn.cancel").click(function() {
        $("#modal-login").modal("hide")
    });
    return false;
};
$(function(){
    var b = $(window);
    var a = $("#back-to-top");
    $(window).scroll(function() {
        var c = b.scrollTop();
        if (c > 300) {
            a.show()
        } else {
            a.hide()
        }
    });
    $("#back-to-top").click(function() {
        $(window).scrollTo(0, 300)
    })
});
$(function() {
    if ($(".navbar").size() < 1) {
        return false
    }
    $(".navbar .username").toggle(function() {
        $(this).addClass("active");
        $(this).next().show()
    },
    function() {
        $(this).removeClass("active");
        $(this).next().hide()
    }); (function() {
        var c = "搜索餐厅、美食";
        $(".navbar .search-box").addClass("gray").val(c);
        $(".navbar .search-box input").val(c);
        $(".navbar .search-box input").focus(function() {
            if ($(this).val() == c) {
                $(this).parent().removeClass("gray");
                $(this).val("")
            }
        }).blur(function() {
            if ($(this).val() === "") {
                $(this).parent().addClass("gray");
                $(this).val(c)
            }
        })
    })();
    var a = function() {
        var e = 0;
        var h = 0;
        var c = 0;
        var j = 0;
        var i = null;
        var g = "";
        var k = "";
        var d = $(".navbar .search-box input").offset().left;
        var f = get_entry_url();
        $(".navbar .search-box input:not(.prefix)").keyup(function(n) {
            if (n.keyCode == "13") {
                if (e <= 0) {
                    window.location = f + "/search?kw=" + $(this).val()
                } else {
                    window.location = i.find("a").attr("href")
                }
            } else {
                var m = $(this).val();
                var o = $(this);
                if (m != k) {
                    k = m;
                    if (m === "") {
                        $("#topbar_search_result").empty().hide();
                        return false
                    }
                    var l = no_cache_url(get_entry_url() + "/search/autocomplete");
                    $.get(l, {
                        keyword: m
                    },
                    function(p) {
                        if (o.val() != "" && o.val() == m && p != "") {
                            $("#topbar_search_result").html(p).css({
                                left: d + "px"
                            }).show();
                            h = $(".result_rest .result_block tr").size() + $(".result_food .result_block tr").size();
                            c = $(".result_rest .result_block tr").size();
                            j = $(".result_food .result_block tr").size()
                        } else {
                            $("#topbar_search_result").empty().hide();
                            return false
                        }
                    })
                }
            }
        }).keydown(function(m) {
            if ("38" == m.keyCode) {
                e--;
                if (e < 1) {
                    e = h
                }
                l()
            } else {
                if ("40" == m.keyCode) {
                    e++;
                    if (e > h) {
                        e = 1
                    }
                    l()
                }
            }
            function n() {
                if (e <= c) {
                    i = $(".result_rest .result_block tr").eq(e - 1)
                } else {
                    i = $(".result_food .result_block tr").eq(e - c - 1)
                }
            }
            function l() {
                n();
                $(".result_block tr td.selected").removeClass("selected");
                i.find("td").addClass("selected")
            }
        })
    };
    a();
    $("body").click(function(c) {
        if (! ($(c.target).parents().is("#topbar_search_result") || $(c.target).parents().is(".search-box"))) {
            $("#topbar_search_result").empty().hide()
        }
    });
    $(".search-box .in-restaurant .icon-remove").click(function() {
        $(this).parent().prev().show();
        $(this).parent().next().removeClass("prefix");
        $(this).parent().remove();
        $(".navbar .search-box input:not(.prefix)").unbind("keyup");
        a()
    });
    $(".navbar .search-box input.prefix").keyup(function() {
        b($(this).val());
        return false
    });
    var b = function(c) {
        if (c === "") {
            $(".food-item").show();
            $(".image-food-item").show();
            $(".food-category").show();
            return false
        }
        $(".food-item").hide();
        $(".image-food-item").hide();
        $(".food-category").hide();
        var d = [];
        $.each(foods_source,
        function(e, f) {
            if (f.search_text.indexOf(c) >= 0) {
                var g = f.id;
                if ($.inArray(f.category_id, d) <= -1) {
                    d.push(f.category_id)
                }
                $("#food-" + g).show()
            }
        });
        $.each(d,
        function(e, f) {
            $("#food-category-" + f).show()
        })
    }
});
$(function() {
    var a = function() {
        function e() {
            return Math.round(Math.random() * 100)
        }
        function c(j, k, l) {
            if (j.nodeType !== 1) {
                throw (j + " is not a dom element node.")
            }
            if (j.addEventListener) {
                j.addEventListener(k, l, false)
            } else {
                if (j.attachEvent) {
                    j.attachEvent("on" + k, l)
                } else {
                    throw ("browser don't support event attach.")
                }
            }
        }
        var b = document.getElementById("trigger");
        var f = document.getElementById("result");
        var g = document.getElementById("lastResult");
        var d = 101;
        var h = new Array();
        f.innerHTML = "";
        function i(n, m) {
            if (h.length >= 10) {
                if (h.shift() == d) {
                    h.shift();
                    h.unshift(d)
                }
            }
            var o = n.getAttribute("count") || 0;
            n.setAttribute("count", ++o);
            do {
                var j = e();
                var l = false;
                for (var k in h) {
                    if (h.hasOwnProperty(k)) {
                        if (h[k] == j) {
                            l = true
                        }
                    }
                }
            } while ( l || j > 100 );
            h.push(j);
            d = d < j ? d: j;
            n.innerHTML = "";
            for (var k in h) {
                if (h.hasOwnProperty(k)) {
                    if (h[k] == d) {
                        n.innerHTML += '<li class="you-item">扔出了一个 ' + h[k] + "</li>"
                    } else {
                        n.innerHTML += "<li>扔出了一个 " + h[k] + "</li>"
                    }
                }
            }
            g.innerHTML = "";
            if (o >= 10) {
                n.setAttribute("rows", o + 1)
            }
            b.focus()
        }
        b.removeAttribute("disabled");
        $("#trigger").click(function() {
            i(f)
        });
        $(document).keydown(function(j) {
            if (j.which === 32) {
                i(f);
                $("#trigger").addClass("active");
                return false
            }
        }).keyup(function(j) {
            $("#trigger").removeClass("active")
        });
        $("#trigger").mousedown(function() {
            $(this).addClass("active")
        });
        $("#trigger").mouseup(function() {
            $(this).removeClass("active")
        })
    };
    $("#shuiqunawaimai_open, #activity-shuiqunawaimai").click(function() {
        a();
        var b = false;
        if (!b) {
            $("#modal-shuiqunawaimai").modal({
                keyboard: true,
                backdrop: "static"
            });
            b = true
        }
        $("#modal-shuiqunawaimai").modal("show");
        return false
    })
});
$(function() {
    $(".promotion_banner_chaoshipeifu").live("click",
    function() {
        var a = false;
        if (!a) {
            $("#overtime_payment").modal({
                keyboard: true,
                backdrop: "static"
            });
            a = true
        }
        $("#overtime_payment").modal("show");
        return false
    });
    $("#overtime_payment_order").live("keyup",
    function() {
        $("#overtime_payment_order").parent().parent().removeClass("error")
    });
    $("#overtime_payment_phone").live("keyup",
    function() {
        $("#overtime_payment_phone").parent().parent().removeClass("error")
    });
    $("#overtime_payment_order").live("blur",
    function() {
        if ($("#overtime_payment_order").val().length == 0 || isNaN($("#overtime_payment_order").val())) {
            $("#overtime_payment_order").parent().parent().addClass("error")
        }
    });
    $("#overtime_payment_phone").live("blur",
    function() {
        if ($("#overtime_payment_phone").val().length == 0 || isNaN($("#overtime_payment_phone").val())) {
            $("#overtime_payment_phone").parent().parent().addClass("error")
        }
    });
    $("#ensure_overtime_payment").live("click",
    function() {
        $("#overtime_payment_order").blur();
        $("#overtime_payment_phone").blur();
        var d = $("#overtime_payment_order").val();
        var c = $("#overtime_payment_phone").val();
        if ($("#overtime_payment_order").val().length > 0 & !isNaN(d) & !isNaN(c) & $("#overtime_payment_phone").val().length > 0) {
            $("#overtime_payment_form").submit()
        }
    })
});
$(".btn.interactive").click(function() {
    var a = $(this);
    a.button("loading")
});
$(function() {
    if ($("#background").size() >= 1) {
        if ($("#background").hasClass("night")) {
            $("body").addClass("night").removeClass("day")
        }
    }
});
$(".alert-close").click(function() {
    $(this).parent().hide()
}); (function() {
    var cB = void 0,
    cz = null,
    dH = encodeURIComponent,
    de = decodeURIComponent,
    cy = Math;
    function cD(h, g) {
        return h.name = g
    }
    var cw = "push",
    b5 = "slice",
    bQ = "replace",
    bC = "load",
    cv = "charAt",
    bk = "value",
    cu = "indexOf",
    a1 = "match",
    ct = "name",
    ay = "host",
    cq = "toString",
    cp = "length",
    cn = "prototype",
    cm = "split",
    cl = "stopPropagation",
    ah = "scope",
    ck = "location",
    cj = "getString",
    ci = "substring",
    b = "navigator",
    dm = "join",
    dk = "toLowerCase",
    di;
    function dQ(h, g) {
        switch (g) {
        case 0:
            return "" + h;
        case 1:
            return h * 1;
        case 2:
            return !! h;
        case 3:
            return h * 1000
        }
        return h
    }
    function dh(g) {
        return cB == g || "-" == g || "" == g
    }
    function dw(g) {
        if (!g || "" == g) {
            return ""
        }
        for (; g && " \n\r\t" [cu](g[cv](0)) > -1;) {
            g = g[ci](1)
        }
        for (; g && " \n\r\t" [cu](g[cv](g[cp] - 1)) > -1;) {
            g = g[ci](0, g[cp] - 1)
        }
        return g
    }
    function cL(h) {
        var g = 1,
        k = 0,
        i;
        if (!dh(h)) {
            g = 0;
            for (i = h[cp] - 1; i >= 0; i--) {
                k = h.charCodeAt(i),
                g = (g << 6 & 268435455) + k + (k << 14),
                k = g & 266338304,
                g = k != 0 ? g ^ k >> 21 : g
            }
        }
        return g
    }
    function ch() {
        return cy.round(cy.random() * 2147483647)
    }
    function bY() {}
    function dg(h, g) {
        return dH instanceof Function ? g ? encodeURI(h) : dH(h) : (df(68), escape(h))
    }
    function c9(h) {
        h = h[cm]("+")[dm](" ");
        if (de instanceof Function) {
            try {
                return de(h)
            } catch(g) {
                df(17)
            }
        } else {
            df(68)
        }
        return unescape(h)
    }
    var bK = function(h, g, k, i) {
        h.addEventListener ? h.addEventListener(g, k, !!i) : h.attachEvent && h.attachEvent("on" + g, k)
    },
    bs = function(h, g, k, i) {
        h.removeEventListener ? h.removeEventListener(g, k, !!i) : h.detachEvent && h.detachEvent("on" + g, k)
    };
    function c7(g) {
        return g && g[cp] > 0 ? g[0] : ""
    }
    function a8(h) {
        var g = h ? h[cp] : 0;
        return g > 0 ? h[g - 1] : ""
    }
    var aT = function() {
        this.prefix = "ga.";
        this.F = {}
    };
    aT[cn].set = function(h, g) {
        this.F[this.prefix + h] = g
    };
    aT[cn].get = function(g) {
        return this.F[this.prefix + g]
    };
    aT[cn].contains = function(g) {
        return this.get(g) !== cB
    };
    function aF(g) {
        g[cu]("www.") == 0 && (g = g[ci](4));
        return g[dk]()
    }
    function ap(h, g) {
        var k, i = {
            url: h,
            protocol: "http",
            host: "",
            path: "",
            c: new aT,
            anchor: ""
        };
        if (!h) {
            return i
        }
        k = h[cu]("://");
        if (k >= 0) {
            i.protocol = h[ci](0, k),
            h = h[ci](k + 3)
        }
        k = h.search("/|\\?|#");
        if (k >= 0) {
            i.host = h[ci](0, k)[dk](),
            h = h[ci](k)
        } else {
            return i.host = h[dk](),
            i
        }
        k = h[cu]("#");
        if (k >= 0) {
            i.anchor = h[ci](k + 1),
            h = h[ci](0, k)
        }
        k = h[cu]("?");
        k >= 0 && (p(i.c, h[ci](k + 1)), h = h[ci](0, k));
        i.anchor && g && p(i.c, i.anchor);
        h && h[cv](0) == "/" && (h = h[ci](1));
        i.path = h;
        return i
    }
    function p(h, g) {
        function m(o, r) {
            h.contains(o) || h.set(o, []);
            h.get(o)[cw](r)
        }
        for (var l = dw(g)[cm]("&"), k = 0; k < l[cp]; k++) {
            if (l[k]) {
                var i = l[k][cu]("=");
                i < 0 ? m(l[k], "1") : m(l[k][ci](0, i), l[k][ci](i + 1))
            }
        }
    }
    function dX(h, g) {
        if (dh(h)) {
            return "-"
        }
        if ("[" == h[cv](0) && "]" == h[cv](h[cp] - 1)) {
            return "-"
        }
        var i = c5.domain;
        i += g && g != "/" ? g: "";
        return h[cu](i) == (h[cu]("http://") == 0 ? 7 : h[cu]("https://") == 0 ? 8 : 0) ? "0": h
    }
    function dD(h, g, i) {
        cy.random() * 100 >= 1 || (h = ["utmt=error", "type=" + h, "utmwv=5.1.6", "utmn=" + ch(), "utmsp=1"], g && h[cw]("api=" + g), i && h[cw]("msg=" + dg(i[ci](0, 100))), c3.p && h[cw]("aip=1"), bz(h[dm]("&")))
    }
    var bh = 0;
    function c2(g) {
        return (g ? "_": "") + bh++
    }
    var aY = c2(),
    aL = c2(),
    aw = c2(),
    af = c2(),
    d2 = c2(),
    c1 = c2(),
    c0 = c2(),
    dN = c2(),
    du = c2(),
    cI = c2(),
    cf = c2(),
    bW = c2(),
    bI = c2(),
    bq = c2(),
    a6 = c2(),
    aR = c2(),
    aE = c2(),
    an = c2(),
    j = c2(),
    dV = c2(),
    dB = c2(),
    cV = c2(),
    cs = c2(),
    b1 = c2(),
    bM = c2(),
    bu = c2(),
    dq = c2(),
    dG = c2(),
    c8 = c2(),
    cC = c2(),
    b4 = c2(),
    bP = c2(),
    bB = c2(),
    bj = c2(),
    a0 = c2(),
    cZ = c2(!0),
    aM = c2(),
    ax = c2(),
    ag = c2(),
    a = c2(),
    dP = c2(),
    dv = c2(),
    cK = c2(),
    cg = c2(),
    bX = c2(),
    bJ = c2(),
    cY = c2(!0),
    br = c2(!0),
    a7 = c2(!0),
    aS = c2(!0),
    ao = c2(!0),
    n = c2(!0),
    dW = c2(!0),
    dC = c2(!0),
    by = c2(!0),
    bg = c2(!0),
    aX = c2(!0),
    cX = c2(!0),
    aJ = c2(!0),
    au = c2(!0),
    Z = c2(!0),
    d1 = c2(!0),
    dM = c2(!0),
    ds = c2(!0),
    cH = c2(!0),
    b9 = c2(!0),
    bU = c2(!0),
    bG = c2(!0),
    bo = c2(!0),
    a4 = c2(!0),
    aP = c2(!0),
    aC = c2(),
    al = c2();
    c2();
    var e = c2(),
    dT = c2(),
    dz = c2(),
    cT = c2(),
    cr = c2(),
    b0 = c2(),
    dn = c2(),
    dF = c2(),
    c6 = c2();
    c2();
    var cA = c2(),
    b3 = c2();
    var bO = function() {
        function g(h, k, i) {
            cW(cU[cn], h, k, i)
        }
        cS("_getName", aw, 58);
        cS("_getAccount", aY, 64);
        cS("_visitCode", cY, 54);
        cS("_getClientInfo", bq, 53, 1);
        cS("_getDetectTitle", aE, 56, 1);
        cS("_getDetectFlash", a6, 65, 1);
        cS("_getLocalGifPath", dq, 57);
        cS("_getServiceMode", dG, 59);
        cR("_setClientInfo", bq, 66, 2);
        cR("_setAccount", aY, 3);
        cR("_setNamespace", aL, 48);
        cR("_setAllowLinker", cf, 11, 2);
        cR("_setDetectFlash", a6, 61, 2);
        cR("_setDetectTitle", aE, 62, 2);
        cR("_setLocalGifPath", dq, 46, 0);
        cR("_setLocalServerMode", dG, 92, cB, 0);
        cR("_setRemoteServerMode", dG, 63, cB, 1);
        cR("_setLocalRemoteServerMode", dG, 47, cB, 2);
        cR("_setSampleRate", bu, 45, 1);
        cR("_setCampaignTrack", aR, 36, 2);
        cR("_setAllowAnchor", bW, 7, 2);
        cR("_setCampNameKey", j, 41);
        cR("_setCampContentKey", b1, 38);
        cR("_setCampIdKey", an, 39);
        cR("_setCampMediumKey", cV, 40);
        cR("_setCampNOKey", bM, 42);
        cR("_setCampSourceKey", dB, 43);
        cR("_setCampTermKey", cs, 44);
        cR("_setCampCIdKey", dV, 37);
        cR("_setCookiePath", c0, 9, 0);
        cR("_setMaxCustomVariables", c8, 0, 1);
        cR("_setVisitorCookieTimeout", dN, 28, 1);
        cR("_setSessionCookieTimeout", du, 26, 1);
        cR("_setCampaignCookieTimeout", cI, 29, 1);
        cR("_setReferrerOverride", ag, 49);
        g("_trackPageview", cU[cn].ka, 1);
        g("_trackEvent", cU[cn].u, 4);
        g("_trackSocial", cU[cn].la, 104);
        g("_trackPageLoadTime", cU[cn].ja, 100);
        g("_trackTrans", cU[cn].ma, 18);
        g("_sendXEvent", cU[cn].t, 78);
        g("_createEventTracker", cU[cn].S, 74);
        g("_getVersion", cU[cn].X, 60);
        g("_setDomainName", cU[cn].s, 6);
        g("_setAllowHash", cU[cn].ba, 8);
        g("_getLinkerUrl", cU[cn].W, 52);
        g("_link", cU[cn].link, 101);
        g("_linkByPost", cU[cn].aa, 102);
        g("_setTrans", cU[cn].ea, 20);
        g("_addTrans", cU[cn].L, 21);
        g("_addItem", cU[cn].J, 19);
        g("_setTransactionDelim", cU[cn].fa, 82);
        g("_setCustomVar", cU[cn].ca, 10);
        g("_deleteCustomVar", cU[cn].U, 35);
        g("_getVisitorCustomVar", cU[cn].Y, 50);
        g("_setXKey", cU[cn].ha, 83);
        g("_setXValue", cU[cn].ia, 84);
        g("_getXKey", cU[cn].Z, 76);
        g("_getXValue", cU[cn].$, 77);
        g("_clearXKey", cU[cn].P, 72);
        g("_clearXValue", cU[cn].Q, 73);
        g("_createXObj", cU[cn].T, 75);
        g("_addIgnoredOrganic", cU[cn].H, 15);
        g("_clearIgnoredOrganic", cU[cn].M, 97);
        g("_addIgnoredRef", cU[cn].I, 31);
        g("_clearIgnoredRef", cU[cn].N, 32);
        g("_addOrganic", cU[cn].K, 14);
        g("_clearOrganic", cU[cn].O, 70);
        g("_cookiePathCopy", cU[cn].R, 30);
        g("_get", cU[cn].V, 106);
        g("_set", cU[cn].da, 107);
        g("_addEventListener", cU[cn].addEventListener, 108);
        g("_removeEventListener", cU[cn].removeEventListener, 109);
        g("_initData", cU[cn].l, 2);
        g("_setVar", cU[cn].ga, 22);
        cR("_setSessionTimeout", du, 27, 3);
        cR("_setCookieTimeout", cI, 25, 3);
        cR("_setCookiePersistence", dN, 24, 1);
        g("_setAutoTrackOutbound", bY, 79);
        g("_setTrackOutboundSubdomains", bY, 81);
        g("_setHrefExamineLimit", bY, 80)
    },
    cW = function(h, g, k, i) {
        h[g] = function() {
            try {
                return df(i),
                k.apply(this, arguments)
            } catch(l) {
                throw dD("exc", g, l && l[ct]),
                l
            }
        }
    },
    cS = function(h, g, k, i) {
        cU[cn][h] = function() {
            try {
                return df(k),
                dQ(this.a.get(g), i)
            } catch(l) {
                throw dD("exc", h, l && l[ct]),
                l
            }
        }
    },
    cR = function(h, g, l, k, i) {
        cU[cn][h] = function(o) {
            try {
                df(l),
                i == cB ? this.a.set(g, dQ(o, k)) : this.a.set(g, i)
            } catch(m) {
                throw dD("exc", h, m && m[ct]),
                m
            }
        }
    },
    bA = function(h, g) {
        return {
            type: g,
            target: h,
            stopPropagation: function() {
                throw "aborted"
            }
        }
    };
    var bi = function(h, g) {
        return g !== "/" ? !1 : (h[cu]("www.google.") == 0 || h[cu](".google.") == 0 || h[cu]("google.") == 0) && !(h[cu]("google.org") > -1) ? !0 : !1
    },
    aZ = function(h) {
        var g = h.get(d2),
        i = h[cj](c0, "/");
        bi(g, i) && h[cl]()
    };
    var d3 = function() {
        var h = {},
        g = {},
        o = new aK;
        this.g = function(s, r) {
            o.add(s, r)
        };
        var m = new aK;
        this.d = function(s, r) {
            m.add(s, r)
        };
        var l = !1,
        k = !1,
        i = !0;
        this.G = function() {
            l = !0
        };
        this.f = function(r) {
            this[bC]();
            this.set(aC, r, !0);
            l = !1;
            m.execute(this);
            l = !0;
            g = {};
            this.i()
        };
        this.load = function() {
            l && (l = !1, this.na(), av(this), k || (k = !0, o.execute(this), ae(this), av(this)), l = !0)
        };
        this.i = function() {
            if (l) {
                if (k) {
                    l = !1,
                    ae(this),
                    l = !0
                } else {
                    this[bC]()
                }
            }
        };
        this.get = function(r) {
            r && r[cv](0) == "_" && this[bC]();
            return g[r] !== cB ? g[r] : h[r]
        };
        this.set = function(t, s, r) {
            t && t[cv](0) == "_" && this[bC]();
            r ? g[t] = s: h[t] = s;
            t && t[cv](0) == "_" && this.i()
        };
        this.m = function(r) {
            h[r] = this.b(r, 0) + 1
        };
        this.b = function(s, r) {
            var t = this.get(s);
            return t == cB || t === "" ? r: t * 1
        };
        this.getString = function(s, r) {
            var t = this.get(s);
            return t == cB ? r: t + ""
        };
        this.na = function() {
            if (i) {
                var r = this[cj](d2, ""),
                s = this[cj](c0, "/");
                bi(r, s) || (h[c1] = h[bI] && r != "" ? cL(r) : 1, i = !1)
            }
        }
    };
    d3[cn].stopPropagation = function() {
        throw "aborted"
    };
    function dO(h, g) {
        for (var g = g || [], k = 0; k < g[cp]; k++) {
            var i = g[k];
            if ("" + h == i || i[cu](h + ".") == 0) {
                return i
            }
        }
        return "-"
    }
    var cJ = function(h, g, m) {
        m = m ? "": h[cj](c1, "1");
        g = g[cm](".");
        if (g[cp] !== 6 || dt(g[0], m)) {
            return ! 1
        }
        var m = g[1] * 1,
        l = g[2] * 1,
        k = g[3] * 1,
        i = g[4] * 1,
        g = g[5] * 1;
        if (! (m >= 0 && l > 0 && k > 0 && i > 0 && g >= 0)) {
            return df(110),
            !1
        }
        h.set(cY, m);
        h.set(ao, l);
        h.set(n, k);
        h.set(dW, i);
        h.set(dC, g);
        return ! 0
    },
    ce = function(h) {
        var g = h.get(cY),
        m = h.get(ao),
        l = h.get(n),
        k = h.get(dW),
        i = h.b(dC, 1);
        g == cB ? df(113) : g == NaN && df(114);
        g >= 0 && m > 0 && l > 0 && k > 0 && i >= 0 || df(115);
        return [h.b(c1, 1), g != cB ? g: "-", m || "-", l || "-", k || "-", i][dm](".")
    },
    bV = function(g) {
        return [g.b(c1, 1), g.b(aX, 0), g.b(cX, 1), g.b(aJ, 0)][dm](".")
    },
    bH = function(h, g, k) {
        var k = k ? "": h[cj](c1, "1"),
        i = g[cm](".");
        if (i[cp] !== 4 || dt(i[0], k)) {
            i = cz
        }
        h.set(aX, i ? i[1] * 1 : 0);
        h.set(cX, i ? i[2] * 1 : 10);
        h.set(aJ, i ? i[3] * 1 : h.get(af));
        return i != cz || !dt(g, k)
    },
    bp = function(h, g) {
        var o = dg(h[cj](a7, "")),
        m = [],
        l = h.get(cZ);
        if (!g && l) {
            for (var k = 0; k < l[cp]; k++) {
                var i = l[k];
                i && i[ah] == 1 && m[cw](k + "=" + dg(i[ct]) + "=" + dg(i[bk]) + "=1")
            }
            m[cp] > 0 && (o += "|" + m[dm](","))
        }
        return o ? h.b(c1, 1) + "." + o: cz
    },
    a5 = function(h, g, m) {
        m = m ? "": h[cj](c1, "1");
        g = g[cm](".");
        if (g[cp] < 2 || dt(g[0], m)) {
            return ! 1
        }
        g = g[b5](1)[dm](".")[cm]("|");
        g[cp] > 0 && h.set(a7, c9(g[0]));
        if (g[cp] <= 1) {
            return ! 0
        }
        for (var m = g[1][cm](g[1][cu](",") == -1 ? "^": ","), l = 0; l < m[cp]; l++) {
            var k = m[l][cm]("=");
            if (k[cp] == 4) {
                var i = {};
                cD(i, c9(k[1]));
                i.value = c9(k[2]);
                i.scope = 1;
                h.get(cZ)[k[0]] = i
            }
        }
        g[1][cu]("^") >= 0 && df(125);
        return ! 0
    },
    aD = function(h, g) {
        var i = aQ(h, g);
        return i ? [h.b(c1, 1), h.b(au, 0), h.b(Z, 1), h.b(d1, 1), i][dm](".") : ""
    },
    aQ = function(h) {
        function g(k, m) {
            if (!dh(h.get(k))) {
                var l = h[cj](k, ""),
                l = l[cm](" ")[dm]("%20"),
                l = l[cm]("+")[dm]("%20");
                i[cw](m + "=" + l)
            }
        }
        var i = [];
        g(ds, "utmcid");
        g(bG, "utmcsr");
        g(b9, "utmgclid");
        g(bU, "utmdclid");
        g(cH, "utmccn");
        g(bo, "utmcmd");
        g(a4, "utmctr");
        g(aP, "utmcct");
        return i[dm]("|")
    },
    f = function(h, g, i) {
        i = i ? "": h[cj](c1, "1");
        g = g[cm](".");
        if (g[cp] < 5 || dt(g[0], i)) {
            return h.set(au, cB),
            h.set(Z, cB),
            h.set(d1, cB),
            h.set(ds, cB),
            h.set(cH, cB),
            h.set(bG, cB),
            h.set(bo, cB),
            h.set(a4, cB),
            h.set(aP, cB),
            h.set(b9, cB),
            h.set(bU, cB),
            !1
        }
        h.set(au, g[1] * 1);
        h.set(Z, g[2] * 1);
        h.set(d1, g[3] * 1);
        am(h, g[b5](4)[dm]("."));
        return ! 0
    },
    am = function(h, g) {
        function l(m) {
            return (m = g[a1](m + "=(.*?)(?:\\|utm|$)")) && m[cp] == 2 ? m[1] : cB
        }
        function k(m, o) {
            o && (o = i ? c9(o) : o[cm]("%20")[dm](" "), h.set(m, o))
        }
        g[cu]("=") == -1 && (g = c9(g));
        var i = l("utmcvr") == "2";
        k(ds, l("utmcid"));
        k(cH, l("utmccn"));
        k(bG, l("utmcsr"));
        k(bo, l("utmcmd"));
        k(a4, l("utmctr"));
        k(aP, l("utmcct"));
        k(b9, l("utmgclid"));
        k(bU, l("utmdclid"))
    },
    dt = function(h, g) {
        return g ? h != g: !/^\d+$/.test(h)
    };
    var aK = function() {
        this.r = []
    };
    aK[cn].add = function(h, g) {
        this.r[cw]({
            name: h,
            xa: g
        })
    };
    aK[cn].execute = function(h) {
        try {
            for (var g = 0; g < this.r[cp]; g++) {
                this.r[g].xa.call(cP, h)
            }
        } catch(i) {}
    };
    function dU(g) {
        g.get(bu) != 100 && g.get(cY) % 10000 >= g.get(bu) * 100 && g[cl]()
    }
    function dA(g) {
        bw() && g[cl]()
    }
    function be(g) {
        c5[ck].protocol == "file:" && g[cl]()
    }
    function aV(g) {
        g.get(ax) || g.set(ax, c5.title, !0);
        g.get(aM) || g.set(aM, c5[ck].pathname + c5[ck].search, !0)
    }
    var aH = new
    function() {
        var g = [];
        this.set = function(h) {
            g[h] = !0
        };
        this.ya = function() {
            for (var h = [], i = 0; i < g[cp]; i++) {
                g[i] && (h[cy.floor(i / 6)] ^= 1 << i % 6)
            }
            for (i = 0; i < h[cp]; i++) {
                h[i] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_" [cv](h[i] || 0)
            }
            return h[dm]("") + "~"
        }
    };
    function df(g) {
        aH.set(g)
    }
    var cP = window,
    c5 = document,
    bw = function() {
        var g = cP._gaUserPrefs;
        return g && g.ioo && g.ioo()
    },
    ar = function(h, g) {
        setTimeout(h, g)
    },
    cO = function(h) {
        for (var g = [], l = c5.cookie[cm](";"), h = RegExp("^\\s*" + h + "=\\s*(.*?)\\s*$"), k = 0; k < l[cp]; k++) {
            var i = l[k][a1](h);
            i && g[cw](i[1])
        }
        return g
    },
    cN = function(h, g, r, m, l) {
        var k;
        k = bw() ? !1 : bi(m, r) ? !1 : !0;
        if (k) {
            if (g && cP[b].userAgent[cu]("Firefox") >= 0) {
                g = g[bQ](/\n|\r/g, " ");
                k = 0;
                for (var i = g[cp]; k < i; ++k) {
                    var o = g.charCodeAt(k) & 255;
                    if (o == 10 || o == 13) {
                        g = g[ci](0, k) + "?" + g[ci](k + 1)
                    }
                }
            }
            g && g[cp] > 2000 && (g = g[ci](0, 2000), df(69));
            h = h + "=" + g + "; path=" + r + "; ";
            l && (h += "expires=" + (new Date((new Date).getTime() + l)).toGMTString() + "; ");
            m && (h += "domain=" + m + ";");
            c5.cookie = h
        }
    };
    var z, dZ, dK = function() {
        if (!z) {
            var h = {},
            g = cP[b],
            i = cP.screen;
            h.D = i ? i.width + "x" + i.height: "-";
            h.C = i ? i.colorDepth + "-bit": "-";
            h.language = (g && (g.language || g.browserLanguage) || "-")[dk]();
            h.javaEnabled = g && g.javaEnabled() ? 1 : 0;
            h.characterSet = c5.characterSet || c5.charset || "-";
            z = h
        }
    },
    dp = function() {
        dK();
        for (var h = z,
        g = cP[b], h = g.appName + g.version + h.language + g.platform + g.userAgent + h.javaEnabled + h.D + h.C + (c5.cookie ? c5.cookie: "") + (c5.referrer ? c5.referrer: ""), g = h[cp], i = cP.history[cp]; i > 0;) {
            h += i--^g++
        }
        return cL(h)
    },
    cF = function(h) {
        dK();
        var g = z;
        h.set(dP, g.D);
        h.set(dv, g.C);
        h.set(bX, g.language);
        h.set(bJ, g.characterSet);
        h.set(cK, g.javaEnabled);
        if (h.get(bq) && h.get(a6)) {
            if (! (g = dZ)) {
                var r, m, l;
                m = "ShockwaveFlash";
                if ((g = (g = cP[b]) ? g.plugins: cB) && g[cp] > 0) {
                    for (r = 0; r < g[cp] && !l; r++) {
                        m = g[r],
                        m[ct][cu]("Shockwave Flash") > -1 && (l = m.description[cm]("Shockwave Flash ")[1])
                    }
                } else {
                    m = m + "." + m;
                    try {
                        r = new ActiveXObject(m + ".7"),
                        l = r.GetVariable("$version")
                    } catch(k) {}
                    if (!l) {
                        try {
                            r = new ActiveXObject(m + ".6"),
                            l = "WIN 6,0,21,0",
                            r.AllowScriptAccess = "always",
                            l = r.GetVariable("$version")
                        } catch(i) {}
                    }
                    if (!l) {
                        try {
                            r = new ActiveXObject(m),
                            l = r.GetVariable("$version")
                        } catch(o) {}
                    }
                    l && (l = l[cm](" ")[1][cm](","), l = l[0] + "." + l[1] + " r" + l[2])
                }
                g = l ? l: "-"
            }
            dZ = g;
            h.set(cg, dZ)
        } else {
            h.set(cg, "-")
        }
    };
    var cM = function() {
        cW(cM[cn], "push", cM[cn][cw], 5);
        cW(cM[cn], "_createAsyncTracker", cM[cn].va, 33);
        cW(cM[cn], "_getAsyncTracker", cM[cn].wa, 34);
        this.q = 0
    };
    cM[cn].va = function(h, g) {
        return c3.k(h, g || "")
    };
    cM[cn].wa = function(g) {
        return c3.o(g)
    };
    cM[cn].push = function(s) {
        this.q > 0 && df(105);
        this.q++;
        for (var r = arguments,
        o = 0,
        m = 0; m < r[cp]; m++) {
            try {
                if (typeof r[m] === "function") {
                    r[m]()
                } else {
                    var l = "",
                    k = r[m][0],
                    i = k.lastIndexOf(".");
                    i > 0 && (l = k[ci](0, i), k = k[ci](i + 1));
                    var h = l == "_gat" ? c3: l == "_gaq" ? b7: c3.o(l);
                    h[k].apply(h, r[m][b5](1))
                }
            } catch(g) {
                o++
            }
        }
        this.q--;
        return o
    };
    var bm = function() {
        function w(y, x, B, A) {
            cB == o[y] && (o[y] = {});
            cB == o[y][x] && (o[y][x] = []);
            o[y][x][B] = A
        }
        function v(y, x, A) {
            if (cB != o[y] && cB != o[y][x]) {
                return o[y][x][A]
            }
        }
        function u(y, x) {
            if (cB != o[y] && cB != o[y][x]) {
                o[y][x] = cB;
                var B = !0,
                A;
                for (A = 0; A < m[cp]; A++) {
                    if (cB != o[y][m[A]]) {
                        B = !1;
                        break
                    }
                }
                B && (o[y] = cB)
            }
        }
        function s(I) {
            var G = "",
            F = !1,
            D, C;
            for (D = 0; D < m[cp]; D++) {
                if (C = I[m[D]], cB != C) {
                    F && (G += m[D]);
                    for (var F = [], B = cB, x = cB, x = 0; x < C[cp]; x++) {
                        if (cB != C[x]) {
                            B = "";
                            x != g && cB == C[x - 1] && (B += x[cq]() + l);
                            for (var y = C[x], J = "", E = cB, H = cB, A = cB, E = 0; E < y[cp]; E++) {
                                H = y[cv](E),
                                A = t[H],
                                J += cB != A ? A: H
                            }
                            B += J;
                            F[cw](B)
                        }
                    }
                    G += k + F[dm](h) + i;
                    F = !1
                } else {
                    F = !0
                }
            }
            return G
        }
        var r = this,
        o = [],
        m = ["k", "v"],
        k = "(",
        i = ")",
        h = "*",
        l = "!",
        t = {
            "'": "'0"
        };
        t[i] = "'1";
        t[h] = "'2";
        t[l] = "'3";
        var g = 1;
        r.qa = function(x) {
            return cB != o[x]
        };
        r.n = function() {
            for (var y = "",
            x = 0; x < o[cp]; x++) {
                cB != o[x] && (y += x[cq]() + s(o[x]))
            }
            return y
        };
        r.pa = function(y) {
            if (y == cB) {
                return r.n()
            }
            for (var x = y.n(), A = 0; A < o[cp]; A++) {
                cB != o[A] && !y.qa(A) && (x += A[cq]() + s(o[A]))
            }
            return x
        };
        r.e = function(x, A, y) {
            if (!bS(y)) {
                return ! 1
            }
            w(x, "k", A, y);
            return ! 0
        };
        r.j = function(x, A, y) {
            if (!bE(y)) {
                return ! 1
            }
            w(x, "v", A, y[cq]());
            return ! 0
        };
        r.getKey = function(x, y) {
            return v(x, "k", y)
        };
        r.z = function(x, y) {
            return v(x, "v", y)
        };
        r.v = function(x) {
            u(x, "k")
        };
        r.w = function(x) {
            u(x, "v")
        };
        cW(r, "_setKey", r.e, 89);
        cW(r, "_setValue", r.j, 90);
        cW(r, "_getKey", r.getKey, 87);
        cW(r, "_getValue", r.z, 88);
        cW(r, "_clearKey", r.v, 85);
        cW(r, "_clearValue", r.w, 86)
    };
    function bS(g) {
        return typeof g == "string"
    }
    function bE(g) {
        return typeof g != "number" && (cB == Number || !(g instanceof Number)) || cy.round(g) != g || g == NaN || g == Infinity ? !1 : !0
    }
    var aA = function(h) {
        var g = cP.gaGlobal;
        h && !g && (cP.gaGlobal = g = {});
        return g
    },
    aj = function() {
        var g = aA(!0).hid;
        if (g == cz) {
            g = ch(),
            aA(!0).hid = g
        }
        return g
    },
    c = function(h) {
        h.set(a, aj());
        var g = aA();
        if (g && g.dh == h.get(c1)) {
            var i = g.sid;
            i && (i == "0" && df(112), h.set(dW, i), h.get(br) && h.set(n, i));
            g = g.vid;
            h.get(br) && g && (g = g[cm]("."), g[1] * 1 || df(112), h.set(cY, g[0] * 1), h.set(ao, g[1] * 1))
        }
    };
    var dR, dx = function(h, g, l) {
        var k = h[cj](d2, ""),
        i = h[cj](c0, "/"),
        h = h.b(dN, 0);
        cN(g, l, i, k, h)
    },
    ae = function(h) {
        var g = h[cj](d2, "");
        h.b(c1, 1);
        var k = h[cj](c0, "/");
        cN("__utma", ce(h), k, g, h.get(dN));
        cN("__utmb", bV(h), k, g, h.get(du));
        cN("__utmc", "" + h.b(c1, 1), k, g);
        var i = aD(h, !0);
        i ? cN("__utmz", i, k, g, h.get(cI)) : cN("__utmz", "", k, g, -1); (i = bp(h, !1)) ? cN("__utmv", i, k, g, h.get(dN)) : cN("__utmv", "", k, g, -1)
    },
    av = function(h) {
        var g = h.b(c1, 1);
        if (!cJ(h, dO(g, cO("__utma")))) {
            return h.set(aS, !0),
            !1
        }
        var i = !bH(h, dO(g, cO("__utmb")));
        h.set(bg, i);
        f(h, dO(g, cO("__utmz")));
        a5(h, dO(g, cO("__utmv")));
        dR = !i;
        return ! 0
    },
    cQ = function(g) { ! dR && !(cO("__utmb")[cp] > 0) && (cN("__utmd", "1", g[cj](c0, "/"), g[cj](d2, ""), 10000), cO("__utmd")[cp] == 0 && g[cl]())
    };
    var bL = function(g) {
        g.get(cY) == cB ? co(g) : g.get(aS) && !g.get(cA) ? co(g) : g.get(bg) && bZ(g)
    },
    bt = function(g) {
        g.get(dM) && !g.get(by) && (bZ(g), g.set(Z, g.get(dC)))
    },
    co = function(h) {
        var g = h.get(af);
        h.set(br, !0);
        h.set(cY, ch() ^ dp(h) & 2147483647);
        h.set(a7, "");
        h.set(ao, g);
        h.set(n, g);
        h.set(dW, g);
        h.set(dC, 1);
        h.set(by, !0);
        h.set(aX, 0);
        h.set(cX, 10);
        h.set(aJ, g);
        h.set(cZ, []);
        h.set(aS, !1);
        h.set(bg, !1)
    },
    bZ = function(g) {
        g.set(n, g.get(dW));
        g.set(dW, g.get(af));
        g.m(dC);
        g.set(by, !0);
        g.set(aX, 0);
        g.set(cX, 10);
        g.set(aJ, g.get(af));
        g.set(bg, !1)
    };
    var dj = "daum:q,eniro:search_word,naver:query,pchome:q,images.google:q,google:q,yahoo:p,yahoo:q,msn:q,bing:q,aol:query,aol:q,lycos:query,ask:q,netscape:query,cnn:query,about:terms,mamma:q,voila:rdata,virgilio:qs,live:q,baidu:wd,alice:qs,yandex:text,najdi:q,seznam:q,search:q,wp:szukaj,onet:qt,szukacz:q,yam:k,kvasir:q,ozu:q,terra:query,rambler:query".split(","),
    bx = function(h) {
        if (h.get(aR) && !h.get(cA)) {
            for (var g = !dh(h.get(ds)) || !dh(h.get(bG)) || !dh(h.get(b9)) || !dh(h.get(bU)), l = {},
            k = 0; k < dE[cp]; k++) {
                var i = dE[k];
                l[i] = h.get(i)
            }
            k = ap(c5[ck].href, h.get(bW));
            if (! (a8(k.c.get(h.get(bM))) == "1" && g) && (!c4(h, k) && !cx(h) && !g && h.get(by) && h.get(by) && b2(h, cB, "(direct)", cB, cB, "(direct)", "(none)", cB, cB), h.set(dM, bN(h, l)), g = h.get(bG) == "(direct)" && h.get(cH) == "(direct)" && h.get(bo) == "(none)", h.get(dM) || h.get(by) && !g)) {
                h.set(au, h.get(af)),
                h.set(Z, h.get(dC)),
                h.m(d1)
            }
        }
    },
    c4 = function(v, u) {
        function t(y, x) {
            var x = x || "-",
            w = a8(u.c.get(v.get(y)));
            return w && w != "-" ? c9(w) : x
        }
        var r = a8(u.c.get(v.get(an))) || "-",
        o = a8(u.c.get(v.get(dB))) || "-",
        m = a8(u.c.get(v.get(dV))) || "-",
        l = a8(u.c.get("dclid")) || "-",
        i = t(j, "(not set)"),
        h = t(cV, "(not set)"),
        g = t(cs),
        k = t(b1);
        if (dh(r) && dh(m) && dh(l) && dh(o)) {
            return ! 1
        }
        if (dh(g)) {
            var s = dX(v.get(ag), v.get(c0)),
            s = ap(s, !0); (s = bf(v, s)) && !dh(s[1] && !s[2]) && (g = s[1])
        }
        b2(v, r, o, m, l, i, h, g, k);
        return ! 0
    },
    cx = function(h) {
        var g = dX(h.get(ag), h.get(c0)),
        l = ap(g, !0);
        if (! (g != cB && g != cz && g != "" && g != "0" && g != "-" && g[cu]("://") >= 0) || l && l[ay][cu]("google") > -1 && l.c.contains("q") && l.path == "cse") {
            return ! 1
        }
        if ((g = bf(h, l)) && !g[2]) {
            return b2(h, cB, g[0], cB, cB, "(organic)", "organic", g[1], cB),
            !0
        } else {
            if (g) {
                return ! 1
            }
        }
        if (h.get(by)) {
            h: {
                for (var g = h.get(bP), k = aF(l[ay]), i = 0; i < g[cp]; ++i) {
                    if (k[cu](g[i]) > -1) {
                        h = !1;
                        break h
                    }
                }
                b2(h, cB, k, cB, cB, "(referral)", "referral", cB, "/" + l.path);
                h = !0
            }
        } else {
            h = !1
        }
        return h
    },
    bf = function(h, g) {
        for (var o = h.get(cC), m = 0; m < o[cp]; ++m) {
            var l = o[m][cm](":");
            if (g[ay][cu](l[0][dk]()) > -1) {
                var k = c7(g.c.get(l[1]));
                if (k && (!l[3] || g.url[cu](l[3]) > -1)) {
                    h: {
                        for (var o = k,
                        m = h.get(b4), o = c9(o)[dk](), i = 0; i < m[cp]; ++i) {
                            if (o == m[i]) {
                                o = !0;
                                break h
                            }
                        }
                        o = !1
                    }
                    return [l[2] || l[0], k, o]
                }
            }
        }
        return cz
    },
    b2 = function(s, r, o, m, l, k, i, h, g) {
        s.set(ds, r);
        s.set(bG, o);
        s.set(b9, m);
        s.set(bU, l);
        s.set(cH, k);
        s.set(bo, i);
        s.set(a4, h);
        s.set(aP, g)
    },
    dE = [cH, ds, b9, bU, bG, bo, a4, aP],
    bN = function(h, g) {
        function m(o) {
            o = ("" + o)[cm]("+")[dm]("%20");
            return o = o[cm](" ")[dm]("%20")
        }
        for (var l = 0; l < dE[cp]; l++) {
            var k = dE[l],
            i = g[k] || "-",
            k = h.get(k) || "-";
            if (m(i) != m(k)) {
                return ! 0
            }
        }
        return ! 1
    };
    var aI = function(g) {
        aW(g, c5[ck].href) ? (g.set(cA, !0), df(12)) : g.set(cA, !1)
    },
    aW = function(w, v) {
        if (!w.get(cf)) {
            return ! 1
        }
        var u = ap(v, w.get(bW)),
        s = c7(u.c.get("__utma")),
        r = c7(u.c.get("__utmb")),
        o = c7(u.c.get("__utmc")),
        m = c7(u.c.get("__utmx")),
        k = c7(u.c.get("__utmz")),
        i = c7(u.c.get("__utmv")),
        u = c7(u.c.get("__utmk"));
        if (cL("" + s + r + o + m + k + i) != u) {
            s = c9(s);
            r = c9(r);
            o = c9(o);
            m = c9(m);
            w: {
                for (var o = s + r + o + m,
                h = 0; h < 3; h++) {
                    for (var l = 0; l < 3; l++) {
                        if (u == cL(o + k + i)) {
                            df(127);
                            u = [k, i];
                            break w
                        }
                        var t = k[bQ](/ /g, "%20"),
                        g = i[bQ](/ /g, "%20");
                        if (u == cL(o + t + g)) {
                            df(128);
                            u = [t, g];
                            break w
                        }
                        t = t[bQ](/\+/g, "%20");
                        g = g[bQ](/\+/g, "%20");
                        if (u == cL(o + t + g)) {
                            df(129);
                            u = [t, g];
                            break w
                        }
                        k = c9(k)
                    }
                    i = c9(i)
                }
                u = cB
            }
            if (!u) {
                return ! 1
            }
            k = u[0];
            i = u[1]
        }
        if (!cJ(w, s, !0)) {
            return ! 1
        }
        bH(w, r, !0);
        f(w, k, !0);
        a5(w, i, !0);
        at(w, m, !0);
        return ! 0
    },
    d0 = function(t, s, r) {
        var o;
        o = ce(t) || "-";
        var m = bV(t) || "-",
        l = "" + t.b(c1, 1) || "-",
        k = Y(t) || "-",
        i = aD(t, !1) || "-",
        t = bp(t, !1) || "-",
        h = cL("" + o + m + l + k + i + t),
        g = [];
        g[cw]("__utma=" + o);
        g[cw]("__utmb=" + m);
        g[cw]("__utmc=" + l);
        g[cw]("__utmx=" + k);
        g[cw]("__utmz=" + i);
        g[cw]("__utmv=" + t);
        g[cw]("__utmk=" + h);
        o = g[dm]("&");
        if (!o) {
            return s
        }
        m = s[cu]("#");
        return r ? m < 0 ? s + "#" + o: s + "&" + o: (r = "", l = s[cu]("?"), m > 0 && (r = s[ci](m), s = s[ci](0, m)), l < 0 ? s + "?" + o + r: s + "&" + o + r)
    };
    var dL = "|",
    cG = function(t, s, r, o, m, l, k, i, h) {
        var g = dr(t, s);
        g || (g = {},
        t.get(bB)[cw](g));
        g.id_ = s;
        g.affiliation_ = r;
        g.total_ = o;
        g.tax_ = m;
        g.shipping_ = l;
        g.city_ = k;
        g.state_ = i;
        g.country_ = h;
        g.items_ = g.items_ || [];
        return g
    },
    b8 = function(s, r, o, m, l, k, i) {
        var s = dr(s, r) || cG(s, r, "", 0, 0, 0, "", "", ""),
        h;
        s: {
            if (s && s.items_) {
                h = s.items_;
                for (var g = 0; g < h[cp]; g++) {
                    if (h[g].sku_ == o) {
                        h = h[g];
                        break s
                    }
                }
            }
            h = cz
        }
        g = h || {};
        g.transId_ = r;
        g.sku_ = o;
        g.name_ = m;
        g.category_ = l;
        g.price_ = k;
        g.quantity_ = i;
        h || s.items_[cw](g);
        return g
    },
    dr = function(h, g) {
        for (var k = h.get(bB), i = 0; i < k[cp]; i++) {
            if (k[i].id_ == g) {
                return k[i]
            }
        }
        return cz
    };
    var bT, bF = function(h) {
        var i;
        var k;
        if (!bT) {
            var g;
            g = c5[ck].hash;
            var m = cP[ct],
            l = /^#?gaso=([^&]*)/;
            if (i = (k = (g = g && g[a1](l) || m && m[a1](l)) ? g[1] : c7(cO("GASO")), g = k) && g[a1](/^(?:\|([-0-9a-z.]{1,40})\|)?([-.\w]{10,1200})$/i), m = i) {
                if (dx(h, "GASO", "" + g), c3._gasoDomain = h.get(d2), c3._gasoCPath = h.get(c0), g = "https://" + ((m[1] || "www") + ".google.com") + "/analytics/reporting/overlay_js?gaso=" + m[2] + "&" + ch()) {
                    h = c5.createElement("script"),
                    h.type = "text/javascript",
                    h.async = !0,
                    h.src = g,
                    h.id = "_gasojs",
                    h.onload = cB,
                    g = c5.getElementsByTagName("script")[0],
                    g.parentNode.insertBefore(h, g)
                }
            }
            bT = !0
        }
    };
    var at = function(h, g, i) {
        i && (g = c9(g));
        i = h.b(c1, 1);
        g = g[cm]("."); ! (g[cp] < 2) && /^\d+$/.test(g[0]) && (g[0] = "" + i, dx(h, "__utmx", g[dm](".")))
    },
    Y = function(h, g) {
        var i = dO(h.get(c1), cO("__utmx"));
        i == "-" && (i = "");
        return g ? dg(i) : i
    };
    var aB = function(h, g) {
        if (h.b(cY, 0) % 100 >= h.b(c6, 0)) {
            return ! 1
        }
        var i = bn();
        i == cB && (i = a3());
        if (i == cB || i == Infinity || isNaN(i)) {
            return ! 1
        }
        i > 0 ? g(aO(i)) : bK(cP, "load",
        function() {
            aB(h, g)
        },
        !1);
        return ! 0
    },
    aO = function(h) {
        var g = new bm,
        i = cy.min(cy.floor(h / 100), 5000);
        g.e(14, 1, i > 0 ? i + "00": "0");
        g.j(14, 1, h);
        return g
    },
    bn = function() {
        var g = cP.performance || cP.webkitPerformance;
        return (g = g && g.timing) && g.loadEventStart - g.fetchStart
    },
    a3 = function() {
        if (cP.top == cP) {
            var h = cP.external,
            g = h && h.onloadT;
            h && !h.isValidLoadTime && (g = cB);
            g > 2147483648 && (g = cB);
            g > 0 && h.setPageReadyTime();
            return g
        }
    };
    var cU = function(h, g, l) {
        function k(m) {
            return function(o) {
                if ((o = o.get(b3)[m]) && o[cp]) {
                    for (var s = bA(i, m), r = 0; r < o[cp]; r++) {
                        o[r].call(i, s)
                    }
                }
            }
        }
        var i = this;
        this.a = new d3;
        this.get = function(m) {
            return this.a.get(m)
        };
        this.set = function(o, m, r) {
            this.a.set(o, m, r)
        };
        this.set(aY, g || "UA-XXXXX-X");
        this.set(aw, h || "");
        this.set(aL, l || "");
        this.set(af, cy.round((new Date).getTime() / 1000));
        this.set(c0, "/");
        this.set(dN, 63072000000);
        this.set(cI, 15768000000);
        this.set(du, 1800000);
        this.set(cf, !1);
        this.set(c8, 50);
        this.set(bW, !1);
        this.set(bI, !0);
        this.set(bq, !0);
        this.set(a6, !0);
        this.set(aR, !0);
        this.set(aE, !0);
        this.set(j, "utm_campaign");
        this.set(an, "utm_id");
        this.set(dV, "gclid");
        this.set(dB, "utm_source");
        this.set(cV, "utm_medium");
        this.set(cs, "utm_term");
        this.set(b1, "utm_content");
        this.set(bM, "utm_nooverride");
        this.set(bu, 100);
        this.set(c6, 10);
        this.set(dq, "/__utm.gif");
        this.set(dG, 1);
        this.set(bB, []);
        this.set(cZ, []);
        this.set(cC, dj);
        this.set(b4, []);
        this.set(bP, []);
        this.s("auto");
        this.set(ag, c5.referrer);
        this.set(b3, {
            hit: [],
            load: []
        });
        this.a.g("0", aI);
        this.a.g("1", bL);
        this.a.g("2", bx);
        this.a.g("3", bt);
        this.a.g("4", k("load"));
        this.a.g("5", bF);
        this.a.d("A", dA);
        this.a.d("B", be);
        this.a.d("C", bL);
        this.a.d("D", dU);
        this.a.d("E", aZ);
        this.a.d("F", ak);
        this.a.d("G", cQ);
        this.a.d("H", aV);
        this.a.d("I", cF);
        this.a.d("J", c);
        this.a.d("K", k("hit"));
        this.a.d("L", d);
        this.a.d("M", dS);
        this.get(af) === 0 && df(111);
        this.a.G()
    };
    di = cU[cn];
    di.h = function() {
        var g = this.get(bj);
        g || (g = new bm, this.set(bj, g));
        return g
    };
    di.oa = function(h) {
        for (var g in h) {
            var i = h[g];
            h.hasOwnProperty(g) && typeof i != "function" && this.set(g, i, !0)
        }
    };
    di.ka = function(g) {
        g && g != cB && (g.constructor + "")[cu]("String") > -1 ? (df(13), this.set(aM, g, !0)) : typeof g === "object" && g !== cz && this.oa(g);
        this.a.f("page")
    };
    di.u = function(h, g, l, k, i) {
        if (h == "" || !bS(h) || g == "" || !bS(g)) {
            return ! 1
        }
        if (l != cB && !bS(l)) {
            return ! 1
        }
        if (k != cB && !bE(k)) {
            return ! 1
        }
        this.set(dT, h, !0);
        this.set(dz, g, !0);
        this.set(cT, l, !0);
        this.set(cr, k, !0);
        this.set(e, !!i, !0);
        this.a.f("event");
        return ! 0
    };
    di.la = function(h, g, k, i) {
        if (!h || !g) {
            return ! 1
        }
        this.set(b0, h[ci](0, 15), !0);
        this.set(dn, g[ci](0, 15), !0);
        this.set(dF, k || c5[ck].href, !0);
        i && this.set(aM, i, !0);
        this.a.f("social");
        return ! 0
    };
    di.ja = function() {
        var g = this;
        return aB(this.a,
        function(h) {
            g.t(h)
        })
    };
    di.ma = function() {
        this.a.f("trans")
    };
    di.t = function(g) {
        this.set(a0, g, !0);
        this.a.f("event")
    };
    di.S = function(h) {
        this.l();
        var g = this;
        return {
            _trackEvent: function(l, k, i) {
                df(91);
                g.u(h, l, k, i)
            }
        }
    };
    di.V = function(g) {
        return this.get(g)
    };
    di.da = function(h, g) {
        if (h) {
            if (h != cB && (h.constructor + "")[cu]("String") > -1) {
                this.set(h, g)
            } else {
                if (typeof h == "object") {
                    for (var i in h) {
                        h.hasOwnProperty(i) && this.set(i, h[i])
                    }
                }
            }
        }
    };
    di.addEventListener = function(h, g) {
        var i = this.get(b3)[h];
        i && i[cw](g)
    };
    di.removeEventListener = function(h, g) {
        for (var k = this.get(b3)[h], i = 0; k && i < k[cp]; i++) {
            if (k[i] == g) {
                k.splice(i, 1);
                break
            }
        }
    };
    di.X = function() {
        return "5.1.6"
    };
    di.s = function(g) {
        this.get(bI);
        g = g == "auto" ? aF(c5.domain) : !g || g == "-" || g == "none" ? "": g[dk]();
        this.set(d2, g)
    };
    di.ba = function(g) {
        this.set(bI, !!g)
    };
    di.W = function(h, g) {
        return d0(this.a, h, g)
    };
    di.link = function(h, g) {
        if (this.a.get(cf) && h) {
            var i = d0(this.a, h, g);
            c5[ck].href = i
        }
    };
    di.aa = function(h, g) {
        this.a.get(cf) && h && h.action && (h.action = d0(this.a, h.action, g))
    };
    di.ea = function() {
        this.l();
        var h = this.a,
        g = c5.getElementById ? c5.getElementById("utmtrans") : c5.utmform && c5.utmform.utmtrans ? c5.utmform.utmtrans: cz;
        if (g && g[bk]) {
            h.set(bB, []);
            for (var g = g[bk][cm]("UTM:"), l = 0; l < g[cp]; l++) {
                g[l] = dw(g[l]);
                for (var k = g[l][cm](dL), i = 0; i < k[cp]; i++) {
                    k[i] = dw(k[i])
                }
                "T" == k[0] ? cG(h, k[1], k[2], k[3], k[4], k[5], k[6], k[7], k[8]) : "I" == k[0] && b8(h, k[1], k[2], k[3], k[4], k[5], k[6])
            }
        }
    };
    di.L = function(h, g, r, m, l, k, i, o) {
        return cG(this.a, h, g, r, m, l, k, i, o)
    };
    di.J = function(h, g, m, l, k, i) {
        return b8(this.a, h, g, m, l, k, i)
    };
    di.fa = function(g) {
        dL = g || "|"
    };
    di.ca = function(h, g, m, l) {
        var k = this.a;
        if (h <= 0 || h > k.get(c8)) {
            h = !1
        } else {
            if (!g || !m || dg(g)[cp] + dg(m)[cp] > 64) {
                h = !1
            } else {
                l != 1 && l != 2 && (l = 3);
                var i = {};
                cD(i, g);
                i.value = m;
                i.scope = l;
                k.get(cZ)[h] = i;
                h = !0
            }
        }
        h && this.a.i();
        return h
    };
    di.U = function(g) {
        this.a.get(cZ)[g] = cB;
        this.a.i()
    };
    di.Y = function(g) {
        return (g = this.a.get(cZ)[g]) && g[ah] == 1 ? g[bk] : cB
    };
    di.ha = function(h, g, i) {
        this.h().e(h, g, i)
    };
    di.ia = function(h, g, i) {
        this.h().j(h, g, i)
    };
    di.Z = function(h, g) {
        return this.h().getKey(h, g)
    };
    di.$ = function(h, g) {
        return this.h().z(h, g)
    };
    di.P = function(g) {
        this.h().v(g)
    };
    di.Q = function(g) {
        this.h().w(g)
    };
    di.T = function() {
        return new bm
    };
    di.H = function(g) {
        g && this.get(b4)[cw](g[dk]())
    };
    di.M = function() {
        this.set(b4, [])
    };
    di.I = function(g) {
        g && this.get(bP)[cw](g[dk]())
    };
    di.N = function() {
        this.set(bP, [])
    };
    di.K = function(h, g, l, k, i) {
        if (h && g) {
            h = [h, g[dk]()][dm](":");
            if (k || i) {
                h = [h, k, i][dm](":")
            }
            k = this.get(cC);
            k.splice(l ? 0 : k[cp], 0, h)
        }
    };
    di.O = function() {
        this.set(cC, [])
    };
    di.R = function(h) {
        this.a[bC]();
        var g = this.get(c0),
        i = Y(this.a);
        this.set(c0, h);
        this.a.i();
        at(this.a, i);
        this.set(c0, g)
    };
    di.l = function() {
        this.a[bC]()
    };
    di.ga = function(g) {
        g && g != "" && (this.set(a7, g), this.a.f("var"))
    };
    var ak = function(h) {
        h.get(aC) !== "trans" && h.b(aX, 0) >= 500 && h[cl]();
        if (h.get(aC) === "event") {
            var g = (new Date).getTime(),
            k = h.b(aJ, 0),
            i = h.b(dW, 0),
            k = cy.floor(0.2 * ((g - (k != i ? k: k * 1000)) / 1000));
            k > 0 && (h.set(aJ, g), h.set(cX, cy.min(10, h.b(cX, 0) + k)));
            h.b(cX, 0) <= 0 && h[cl]()
        }
    },
    dS = function(g) {
        g.get(aC) === "event" && g.set(cX, cy.max(0, g.b(cX, 10) - 1))
    };
    var dy = function() {
        var g = [];
        this.add = function(h, k, i) {
            i && (k = dg("" + k));
            g[cw](h + "=" + k)
        };
        this.toString = function() {
            return g[dm]("&")
        }
    },
    bv = function(h, g) { (g || h.get(dG) != 2) && h.m(aX)
    },
    a9 = function(h, g) {
        g.add("utmwv", "5.1.6");
        g.add("utms", h.get(aX));
        g.add("utmn", ch());
        var i = c5[ck].hostname;
        dh(i) || g.add("utmhn", i, !0);
        i = h.get(bu);
        i != 100 && g.add("utmsp", i, !0)
    },
    aG = function(h, g) {
        g.add("utmac", h.get(aY));
        h.get(e) && g.add("utmni", 1);
        aU(h, g);
        c3.p && g.add("aip", 1);
        g.add("utmu", aH.ya())
    },
    aU = function(h, g) {
        function k(m, l) {
            l && i[cw](m + "=" + l + ";")
        }
        var i = [];
        k("__utma", ce(h));
        k("__utmz", aD(h, !1));
        k("__utmv", bp(h, !0));
        k("__utmx", Y(h));
        g.add("utmcc", i[dm]("+"), !0)
    },
    aq = function(h, g) {
        h.get(bq) && (g.add("utmcs", h.get(bJ), !0), g.add("utmsr", h.get(dP)), g.add("utmsc", h.get(dv)), g.add("utmul", h.get(bX)), g.add("utmje", h.get(cK)), g.add("utmfl", h.get(cg), !0))
    },
    q = function(h, g) {
        h.get(aE) && h.get(ax) && g.add("utmdt", h.get(ax), !0);
        g.add("utmhid", h.get(a));
        g.add("utmr", dX(h.get(ag), h.get(c0)), !0);
        g.add("utmp", dg(h.get(aM), !0), !0)
    },
    dY = function(h, g) {
        for (var o = h.get(bj), m = h.get(a0), l = h.get(cZ) || [], k = 0; k < l[cp]; k++) {
            var i = l[k];
            i && (o || (o = new bm), o.e(8, k, i[ct]), o.e(9, k, i[bk]), i[ah] != 3 && o.e(11, k, "" + i[ah]))
        } ! dh(h.get(dT)) && !dh(h.get(dz)) && (o || (o = new bm), o.e(5, 1, h.get(dT)), o.e(5, 2, h.get(dz)), l = h.get(cT), l != cB && o.e(5, 3, l), l = h.get(cr), l != cB && o.j(5, 1, l));
        o ? g.add("utme", o.pa(m), !0) : m && g.add("utme", m.n(), !0)
    },
    dJ = function(h, g, k) {
        var i = new dy;
        bv(h, k);
        a9(h, i);
        i.add("utmt", "tran");
        i.add("utmtid", g.id_, !0);
        i.add("utmtst", g.affiliation_, !0);
        i.add("utmtto", g.total_, !0);
        i.add("utmttx", g.tax_, !0);
        i.add("utmtsp", g.shipping_, !0);
        i.add("utmtci", g.city_, !0);
        i.add("utmtrg", g.state_, !0);
        i.add("utmtco", g.country_, !0); ! k && aG(h, i);
        return i[cq]()
    },
    dl = function(h, g, k) {
        var i = new dy;
        bv(h, k);
        a9(h, i);
        i.add("utmt", "item");
        i.add("utmtid", g.transId_, !0);
        i.add("utmipc", g.sku_, !0);
        i.add("utmipn", g.name_, !0);
        i.add("utmiva", g.category_, !0);
        i.add("utmipr", g.price_, !0);
        i.add("utmiqt", g.quantity_, !0); ! k && aG(h, i);
        return i[cq]()
    },
    cE = function(h, g) {
        var o = h.get(aC);
        if (o == "page") {
            o = new dy,
            bv(h, g),
            a9(h, o),
            dY(h, o),
            aq(h, o),
            q(h, o),
            g || aG(h, o),
            o = [o[cq]()]
        } else {
            if (o == "event") {
                o = new dy,
                bv(h, g),
                a9(h, o),
                o.add("utmt", "event"),
                dY(h, o),
                aq(h, o),
                q(h, o),
                !g && aG(h, o),
                o = [o[cq]()]
            } else {
                if (o == "var") {
                    o = new dy,
                    bv(h, g),
                    a9(h, o),
                    o.add("utmt", "var"),
                    !g && aG(h, o),
                    o = [o[cq]()]
                } else {
                    if (o == "trans") {
                        for (var o = [], m = h.get(bB), l = 0; l < m[cp]; ++l) {
                            o[cw](dJ(h, m[l], g));
                            for (var k = m[l].items_, i = 0; i < k[cp]; ++i) {
                                o[cw](dl(h, k[i], g))
                            }
                        }
                    } else {
                        o == "social" ? g ? o = [] : (o = new dy, bv(h, g), a9(h, o), o.add("utmt", "social"), o.add("utmsn", h.get(b0), !0), o.add("utmsa", h.get(dn), !0), o.add("utmsid", h.get(dF), !0), dY(h, o), aq(h, o), q(h, o), aG(h, o), o = [o[cq]()]) : o = []
                    }
                }
            }
        }
        return o
    },
    d = function(h) {
        var g, r = h.get(al),
        m = h.get(dG);
        if (m == 0 || m == 2) {
            var l = h.get(dq) + "?";
            g = cE(h, !0);
            for (var k = 0,
            i = g[cp]; k < i; k++) {
                bz(g[k], m != 2 && k == i - 1 && r, l, !0)
            }
        }
        if (m == 1 || m == 2) {
            g = cE(h);
            k = 0;
            for (i = g[cp]; k < i; k++) {
                try {
                    bz(g[k], k == i - 1 && r)
                } catch(o) {
                    o && dD(o[ct], cB, o.message)
                }
            }
        }
    };
    var b6 = "https:" == c5[ck].protocol ? "https://ssl.google-analytics.com": "http://www.google-analytics.com",
    bR = function(g) {
        cD(this, "len");
        this.message = g + "-8192"
    },
    bD = function(g) {
        cD(this, "ff2post");
        this.message = g + "-2036"
    },
    bz = function(h, g, k, i) {
        g = g || bY;
        if (i || h[cp] <= 2036) {
            bl(h, g, k)
        } else {
            if (h[cp] <= 8192) {
                if (cP[b].userAgent[cu]("Firefox") >= 0 && ![].reduce) {
                    throw new bD(h[cp])
                }
                a2(h, g) || aN(h, g)
            } else {
                throw new bR(h[cp])
            }
        }
    },
    bl = function(h, g, k) {
        var k = k || b6 + "/__utm.gif?",
        i = new Image(1, 1);
        i.src = k + h;
        i.onload = function() {
            i.onload = cz;
            g()
        }
    },
    a2 = function(h, g) {
        var l, k = b6 + "/p/__utm.gif",
        i = cP.XDomainRequest;
        if (i) {
            l = new i,
            l.open("POST", k)
        } else {
            if (i = cP.XMLHttpRequest) {
                i = new i,
                "withCredentials" in i && (l = i, l.open("POST", k, !0), l.setRequestHeader("Content-Type", "text/plain"))
            }
        }
        if (l) {
            return l.onreadystatechange = function() {
                l.readyState == 4 && (g(), l = cz)
            },
            l.send(h),
            !0
        }
    },
    aN = function(s, r) {
        if (c5.body) {
            s = dH(s);
            try {
                var o = c5.createElement('<iframe name="' + s + '"></iframe>')
            } catch(m) {
                o = c5.createElement("iframe"),
                cD(o, s)
            }
            o.height = "0";
            o.width = "0";
            o.style.display = "none";
            o.style.visibility = "hidden";
            var l = c5[ck],
            l = b6 + "/u/post_iframe.html#" + dH(l.protocol + "//" + l[ay] + "/favicon.ico"),
            k = function() {
                o.src = "";
                o.parentNode && o.parentNode.removeChild(o)
            };
            bK(cP, "beforeunload", k);
            var i = !1,
            h = 0,
            g = function() {
                if (!i) {
                    try {
                        if (h > 9 || o.contentWindow[ck][ay] == c5[ck][ay]) {
                            i = !0;
                            k();
                            bs(cP, "beforeunload", k);
                            r();
                            return
                        }
                    } catch(t) {}
                    h++;
                    setTimeout(g, 200)
                }
            };
            bK(o, "load", g);
            c5.body.appendChild(o);
            o.src = l
        } else {
            ar(function() {
                aN(s, r)
            },
            100)
        }
    };
    var dI = function() {
        this.p = !1;
        this.A = {};
        this.B = [];
        this.ra = 0;
        this._gasoCPath = this._gasoDomain = cB;
        cW(dI[cn], "_createTracker", dI[cn].k, 55);
        cW(dI[cn], "_getTracker", dI[cn].ta, 0);
        cW(dI[cn], "_getTrackerByName", dI[cn].o, 51);
        cW(dI[cn], "_getTrackers", dI[cn].ua, 130);
        cW(dI[cn], "_anonymizeIp", dI[cn].sa, 16);
        bO()
    };
    di = dI[cn];
    di.ta = function(h, g) {
        return this.k(h, cB, g)
    };
    di.k = function(h, g, i) {
        g && df(23);
        i && df(67);
        g == cB && (g = "~" + c3.ra++);
        h = new cU(g, h, i);
        c3.A[g] = h;
        c3.B[cw](h);
        return h
    };
    di.o = function(g) {
        g = g || "";
        return c3.A[g] || c3.k(cB, g)
    };
    di.ua = function() {
        return c3.B[b5](0)
    };
    di.sa = function() {
        this.p = !0
    };
    var az = function(g) {
        if (c5.webkitVisibilityState == "prerender") {
            return ! 1
        }
        g();
        return ! 0
    };
    var c3 = new dI;
    var ai = cP._gat;
    ai && typeof ai._getTracker == "function" ? c3 = ai: cP._gat = c3;
    var b7 = new cM; (function(h) {
        if (!az(h)) {
            df(123);
            var g = !1,
            i = function() { ! g && az(h) && (df(124), g = !0, bs(c5, "webkitvisibilitychange", i))
            };
            bK(c5, "webkitvisibilitychange", i)
        }
    })(function() {
        var h = cP._gaq,
        g = !1;
        if (h && typeof h[cw] == "function" && (g = Object[cn][cq].call(Object(h)) == "[object Array]", !g)) {
            b7 = h;
            return
        }
        cP._gaq = b7;
        g && b7[cw].apply(b7, h)
    })
})();